Ionic issue with gulp-sass and node 4.1.1 - node.js

This is my enviroment with the command ionic info
Your system information:
Cordova CLI: 5.3.3
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.0
Ionic Version: 1.1.0
Ionic CLI Version: 1.6.5
Ionic App Lib Version: 0.3.9
OS: Windows 8
Node Version: v4.1.1
When I run the command npm install, I get the following error:
node-sass#2.1.1 install C:\Users\FIDEL-CASA\Desktop\prueba\dsfasdfa\fidel\node
modules\gulp-sass\nodemodules\node-sass
node scripts/install.js
Can not download file from https://raw.githubusercontent.com/sass/node-sass-binaries/v2.1.1/win32-x64-node-4.1/binding.node
node-sass#2.1.1 postinstall C:\Users\FIDEL-CASA\Desktop\prueba\dsfasdfa\fidel\
node_modules\gulp-sass\node_modules\node-sass
node scripts/build.js
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: 404 status code downloading 64-bit node.lib
gyp ERR! stack at Request. (C:\Users\FIDEL-CASA\Desktop\prueba\ds
fasdfa\fidel\node_modules\gulp-sass\node_modules\node-sass\node_modules\pangyp\l
ib\install.js:403:20)
gyp ERR! stack at emitOne (events.js:82:20)
gyp ERR! stack at Request.emit (events.js:169:7)
gyp ERR! stack at Request.onRequestResponse (C:\Users\FIDEL-CASA\Desktop\pru
eba\dsfasdfa\fidel\node_modules\gulp-sass\node_modules\node-sass\node_modules\pa
ngyp\node_modules\request\request.js:1255:10)
gyp ERR! stack at emitOne (events.js:77:13)
gyp ERR! stack at ClientRequest.emit (events.js:169:7)
gyp ERR! stack at HTTPParser.parserOnIncomingClient (httpclient.js:415:21)
gyp ERR! stack at HTTPParser.parserOnHeadersComplete (httpcommon.js:88:23)
gyp ERR! stack at Socket.socketOnData (httpclient.js:305:20)
gyp ERR! stack at emitOne (events.js:77:13)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\FIDEL-CASA\D
esktop\prueba\dsfasdfa\fidel\node_modules\gulp-sass\node_modules\node-sas
s\node_modules\pangyp\bin\node-gyp" "rebuild"
gyp ERR! cwd C:\Users\FIDEL-CASA\Desktop\prueba\dsfasdfa\fidel\node_modules\gulp
-sass\node_modules\node-sass
gyp ERR! node -v v4.1.1
gyp ERR! pangyp -v v2.3.2
gyp ERR! not ok
Build failed
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v4.1.1
npm ERR! npm v2.14.4
npm ERR! path C:\Users\FIDEL-CASA\AppData\Roaming\npm-cache\lodash.template\3.6.
2\package\package.json.85c499c6dffff9035680b8e91062bf92
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\FIDEL-CASA\AppD
ata\Roaming\npm-cache\lodash.template\3.6.2\package\package.json.85c499c6dffff90
35680b8e91062bf92' -> 'C:\Users\FIDEL-CASA\AppData\Roaming\npm-cache\lodash.temp
late\3.6.2\package\package.json'
npm ERR! at Error (native)
npm ERR! { [Error: EPERM: operation not permitted, rename 'C:\Users\FIDEL-CASA\
AppData\Roaming\npm-cache\lodash.template\3.6.2\package\package.json.85c499c6dff
ff9035680b8e91062bf92' -> 'C:\Users\FIDEL-CASA\AppData\Roaming\npm-cache\lodash.
template\3.6.2\package\package.json']
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\Users\FIDEL-CASA\AppData\Roaming\npm-cache\lodash.tem
plate\3.6.2\package\package.json.85c499c6dffff9035680b8e91062bf92',
npm ERR! dest: 'C:\Users\FIDEL-CASA\AppData\Roaming\npm-cache\lodash.tem
plate\3.6.2\package\package.json',
npm ERR! parent: 'gulp-util' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\FIDEL-CASA\Desktop\prueba\dsfasdfa\fidel\npm-debug.log
I think the problem is caused by the version of "gulp-sass": "^1.3.3" which uses the "node-sass" : "^2.0.1". Here https://goo.gl/jFeu7s said that this node-sass version does not work with node v4.1.1, it does not work even with the node v4.0.0.
Do you recommend in this case back to node v0.12.7 ?
Why Ionic not use a more recent gulp-sass version to resolve that issue?

I was having same problem with my node version 4.*, yes it is caused by
"gulp-sass": "^1.3.3"
I solved my issue with this. First remove gulp-sass dependency from the package.json, Then try
npm install --save gulp-sass#2
or
npm install --save-dev gulp-sass#2

I've just fixed problems with libsass or node-sass with this command:
$ sudo rm -rf node_modules/ && cat package.json | sed -i.bak 's/"gulp-sass": "^X.X.X"/"gulp-sass": "^2.0.4"/g' package.json && npm install && ionic lib update
Where X is the version of gulp-sass in your package.json
Explanation:
Remove the old files in node_modules. I'm not sure is necessary to use 'sudo' (in my case, yes).
$ sudo rm -rf node_modules/
Search and replace inside package.json updating gulp-sass version to ^2.0.4. It also creates a backup (package.json.bak),
$ cat package.json | sed -i.bak 's/"gulp-sass": "^X.X.X"/"gulp-sass": "^2.0.4"/g' package.json
Reinstall dependencies
$ npm install
Update the ionic lib in the project
ionic lib update
If you have any further problems be sure I try can help you...
Bye

Related

node-sass Issue on my angular project npm install (Mac OS)

I try to install node_modules for my angular project an I get issue for node-sass
I use mac os, node js version -> v16.13.2, node-sass version in project ->^4.14.1
In this image1 and image2 is package.json
The error that I get is :
npm ERR! 1 warning and 1 error generated.
npm ERR! make: *** [Release/obj.target/binding/src/binding.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (../node_modules/node-gyp/lib/build.js:262:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 20.6.0
npm ERR! gyp ERR! command "/usr/local/bin/node" ".../node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd .../node_modules/node-sass
npm ERR! gyp ERR! node -v v16.13.2
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
npm ERR! A complete log of this run can be found in:
npm ERR! .../.npm/_logs/2022-01-25T10_04_49_137Z-debug-0.log
I tied this commands npm install -g node-sass, npm uninstall -g node-sass
The same I tried to install latest version of node-sass
I found a solution to this problem. Simply to downgrade node version and it works
You might want to run npm upgrade to have npm check for outdated version of your dependencies.
Because for node 16 you need node-sass in version 6.0+
Just remove node-sass from your package.json ... that solved the problem for me

NPM: libsass error when running install on Mac OS

I'm trying to run a legacy React app locally for the first time. I'm on a new Mac M1 with Big Sur 11.5.2. My node version is 16.9.0, and I made python3 the default (although the app seems to be looking for python2). I also upgraded CommandLineTools to the latest version.
But when I do a simple npm install, I get lots of warnings, and finally this error:
npm ERR! /Users/cd/.node-gyp/16.9.0/include/node/v8-internal.h:489:38: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'?
npm ERR! !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! ~~~~~^~~~~~~~~~~
npm ERR! remove_cv
npm ERR! /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:776:50: note: 'remove_cv' declared here
npm ERR! template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
npm ERR! ^
npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/binding/src/binding.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/Users/cd/develop/storybook/webclient/node_modules/node-gyp/lib/build.js:262:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 20.6.0
npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node/16.9.0/bin/node" "/Users/cd/develop/storybook/webclient/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /Users/cd/develop/storybook/webclient/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.9.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
I'm not proficient enough with node to understand exactly how to troubleshoot this, beyond the steps I've already taken. Clearly something is wrong with node-sass, so I installed it separately with:
sudo npm install --unsafe-perm -g node-sass
That works, but when I re-run npm install to get all the dependencies, I get the same error.
Upgrade node-sass to a version higher than 6.0.1 (mine was 4.0.0) solves this issue
Ref: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'?
try this
rm -rf node_modules package-lock.json
npm install --saveDev node-sass
npm install

Node Gyp Rebuild Error for Hubot-nagios4 node module

I am trying to install hubot-nagios4 module . Everytime i try installing with the command sudo npm install hubot-nagios4 --save i get the below error. I am currently using node version 6.9.1 and npm version 3.10.1.
unameit#Unameit:~/node/example2$ sudo npm install hubot-nagios4 --save
> contextify#0.1.15 install /home/unameit/node/example2/node_modules/contextify
> node-gyp rebuild
gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/unameit/.node-gyp/6.9.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/unameit/node/example2/node_modules/contextify/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: unable to get local issuer certificate
gyp ERR! stack at Error (native)
gyp ERR! stack at TLSSocket.<anonymous> (_tls_wrap.js:1062:38)
gyp ERR! stack at emitNone (events.js:86:13)
gyp ERR! stack at TLSSocket.emit (events.js:185:7)
gyp ERR! stack at TLSSocket._finishInit (_tls_wrap.js:586:8)
gyp ERR! stack at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:416:38)
gyp ERR! System Linux 3.13.0-74-generic
gyp ERR! command "/mnt/node/node-v6.9.1-linux-x86/bin/node" "/mnt/node/node-v6.9.1-linux-x86/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/unameit/node/example2/node_modules/contextify
gyp ERR! node -v v6.9.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN example2#0.0.0 No repository field.
npm ERR! Linux 3.13.0-74-generic
npm ERR! argv "/mnt/node/node-v6.9.1-linux-x86/bin/node" "/usr/local/bin/npm" "install" "hubot-nagios4" "--save"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! contextify#0.1.15 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the contextify#0.1.15 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the contextify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs contextify
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls contextify
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/unameit/node/example2/npm-debug.log
Please assist

Error installing sqlite3 in node.js

I have a problem installing package in node.js. My version of npm is 2.14.3 and I need to install sqlite3 package.
In my proyect path Im usign this command: "npm install sqlite3 --save" I have the next error:
npm WARN package.json node-sqlite#1.0.1 No description npm WARN
package.json node-sqlite#1.0.1 No repository field. npm WARN
package.json node-sqlite#1.0.1 No README data npm WARN package.json
node-sqlite#1.0.1 No license field. /
sqlite3#3.1.8 install /home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3
node-pre-gyp install --fallback-to-build node-pre-gyp ERR! Tried to download(403):
https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.8/node-v46-linux-arm.tar.gz node-pre-gyp ERR! Pre-built binaries not found for sqlite3#3.1.8 and
node#4.1.0 (node-v46 ABI) (falling back to source compile with
node-gyp) make: Entering directory
'/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/build'
ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep
Release/obj/gen/sqlite-autoconf-3150000/sqlite3.c TOUCH
Release/obj.target/deps/action_before_build.stamp CC(target)
Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o
Release/obj/gen/sqlite-autoconf-3150000/sqlite3.c:199451:1: fatal
error: opening dependency file
./Release/.deps/Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o.d.raw:
No such file or directory compilation terminated.
deps/sqlite3.target.mk:120: recipe for target
'Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o'
failed make: ***
[Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o]
Error 1 make: Leaving directory
'/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/build' gyp
ERR! build error gyp ERR! stack Error: make failed with exit code:
2 gyp ERR! stack at ChildProcess.onExit
(/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at
ChildProcess.emit (events.js:172:7) gyp ERR! stack at
Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.21-v7+ gyp ERR! command
"/usr/local/bin/node"
"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js"
"build" "--fallback-to-build"
"--module=/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/lib/binding/node-v46-linux-arm/node_sqlite3.node"
"--module_name=node_sqlite3"
"--module_path=/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/lib/binding/node-v46-linux-arm"
gyp ERR! cwd /home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3
gyp ERR! node -v v4.1.0 gyp ERR! node-gyp -v v3.0.3 gyp ERR! not ok
node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed
to execute '/usr/local/bin/node
/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
build --fallback-to-build
--module=/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/lib/binding/node-v46-linux-arm/node_sqlite3.node
--module_name=node_sqlite3 --module_path=/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/lib/binding/node-v46-linux-arm'
(1) node-pre-gyp ERR! stack at ChildProcess.
(/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:87:13) node-pre-gyp
ERR! stack at ChildProcess.emit (events.js:172:7) node-pre-gyp
ERR! stack at maybeClose (internal/child_process.js:817:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit
(internal/child_process.js:211:5) node-pre-gyp ERR! System Linux
4.4.21-v7+ node-pre-gyp ERR! command "/usr/local/bin/node" "/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/node_modules/.bin/node-pre-gyp"
"install" "--fallback-to-build" node-pre-gyp ERR! cwd
/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3 node-pre-gyp
ERR! node -v v4.1.0 node-pre-gyp ERR! node-pre-gyp -v v0.6.31
node-pre-gyp ERR! not ok Failed to execute '/usr/local/bin/node
/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
build --fallback-to-build
--module=/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/lib/binding/node-v46-linux-arm/node_sqlite3.node
--module_name=node_sqlite3 --module_path=/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/lib/binding/node-v46-linux-arm'
(1) npm ERR! Linux 4.4.21-v7+ npm ERR! argv "/usr/local/bin/node"
"/usr/local/bin/npm" "install" "sqlite3" "--save" npm ERR! node v4.1.0
npm ERR! npm v2.14.3 npm ERR! code ELIFECYCLE npm ERR! sqlite3#3.1.8
install: node-pre-gyp install --fallback-to-build npm ERR! Exit
status 1 npm ERR! npm ERR! Failed at the sqlite3#3.1.8 install script
'node-pre-gyp install --fallback-to-build'. npm ERR! This is most
likely a problem with the sqlite3 package, npm ERR! not with npm
itself. npm ERR! Tell the author that this fails on your system: npm
ERR! node-pre-gyp install --fallback-to-build npm ERR! You can get
their info via: npm ERR! npm owner ls sqlite3 npm ERR! There is
likely additional logging output above. npm ERR! Please include the
following file with any support request: npm ERR!
/home/pi/Desktop/node-sqlite_Sockets/npm-debug.log
If I try to execute my node.js program I have the next error:
module.js:338 throw err; ^ Error: Cannot find module
'/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/lib/binding/node-v46-linux-arm/node_sqlite3.node'
at Function.Module._resolveFilename (module.js:336:15) at
Function.Module._load (module.js:286:25) at Module.require
(module.js:365:17) at require (module.js:384:17) at Object.
(/home/pi/Desktop/node-sqlite_Sockets/node_modules/sqlite3/lib/sqlite3.js:4:15)
at Module._compile (module.js:434:26) at Object.Module._extensions..js
(module.js:452:10) at Module.load (module.js:355:32) at
Function.Module._load (module.js:310:12) at Module.require
(module.js:365:17)
After update (npm install -g npm)
npm WARN checkPermissions Missing write access to
/usr/local/lib/node_modules/npm
npm WARN checkPermissions Missing write access to
/usr/local/lib/node_modules
/usr/local/lib
└── npm#3.10.9
npm ERR! Linux 4.4.21-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/ npm" "install"
"-g" "npm" npm ERR! node v4.1.0 npm ERR! npm v3.10.9 npm ERR! path
/usr/local/lib/node_modules/npm
npm ERR! code EACCES npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access
'/usr/local/lib/node_modules/npm' npm ERR! at Error (native) npm
ERR! { [Error: EACCES: permission denied, access
'/usr/local/lib/node_modules/npm'] npm ERR! errno: -13, npm ERR!
code: 'EACCES', npm ERR! syscall: 'access', npm ERR! path:
'/usr/local/lib/node_modules/npm' } npm ERR! npm ERR! Please try
running this command again as root/Administrator. npm ERR! Please
include the following file with any support request: npm ERR!
/home/pi/Desktop/node-sqlite_Sockets/npm-debug.log
Somebody know how to solve it?
Thanks in advance!
Best regards.
have you installed sqlite3 before on another app? because your cached files could be corrupt. try to remove it from your cache with npm cache clean sqlite3 or clean your whole cache with npm cache clean and run the install script again.
Edit: after you edited your question. it seems to be a permission error. Try running the npm update with sudo npm install -g npm
Summary: It was a problem with an old npm version. The update to a newer version solved it by running sudo npm install -g npm.
This worked for me on Windows 10.
npm uninstall sqlite3
npm cache clean
npm install sqlite3
None of the answers in different stackoverflow threads worked for me.
I deleted the cache, deleted the lock file, installed another version of Node, updated NPM, etc., but none of them worked. Maybe my answer is off-topic, But if you just want to get the job done right now, you may be able to install the package you want with another tool like yarn:
yarn add <package>
is equivalent to
npm i --save <package>
For example, SQLite3 and Sequelize could not be installed on my computer with NPM, which I could install with Yarn.
This worked for me:
Previously app directory was /My Files/TestApp and it always threw that error.
According to a suggestion on https://github.com/mapbox/node-sqlite3/issues/1538, I moved the directory to another directory that doesn't have spaces in the path (/FolderNameWithoutSpaces/TestApp)
And it worked
macOS Monterey v12.1
node version: v17.3.1
npm version: v8.3.0
This may not be the exact answer to the above question, but for some people, it will work.
On linux you should check that you have python installed python --version, if not, you should check this https://stackoverflow.com/a/46245617/9477206
Edit on 2022 : Please check the supported version of Node in sqlite npm documentation and use the supported Node version (mostly by downgrading using nvm)
For me the node verion is v16.x whereas the Sqlite max supported version is v12.x, so I downgraded and the issues went off!
This worked for me:
First, I had Visual C++ 2013 installed, then configured globally by running
npm config set msvs_version 2013 --global
Then I ran an installation of node-gyp by running npm install node-gyp -g node-gyp
Finally, I installed Sqlite3 by running npm install sqlite3
Hope this helps someone as it had helped me

npm failing (gyp error and install script error) during npm install homebridge on debian

I am trying to install homebridge package on debian on my Dragonboard 410c using 'npm install -g homebridge'. However, I keep running into the following error pasted below. I have already installed nodejs-legacy.
Is there a solution to this problem, or is there an alternative way to download and install the package ánd its dependencies without npm?
npm WARN excluding symbolic link utils/ncov -> lib/ncov.js
\
curve25519#1.1.0 install /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/curve25519
node-gyp rebuild
(node) child_process: options.customFds option is deprecated. Use options.stdio instead.
make: Entering directory '/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/curve25519/build'
CXX(target) Release/obj.target/curve/node_curve.o
SOLINK_MODULE(target) Release/obj.target/curve.node
COPY Release/curve.node
make: Leaving directory '/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/curve25519/build'
npm WARN excluding symbolic link utils/ncov -> lib/ncov.js
bignum#0.11.0 install /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/srp/node_modules/bignum
node-gyp configure build
(node) child_process: options.customFds option is deprecated. Use options.stdio instead.
gyp: Undefined variable openssl_config_path in binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:344:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.0-linaro-lt-qcom
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "configure" "build"
gyp ERR! cwd /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/srp/node_modules/bignum
gyp ERR! node -v v4.2.2
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
mdns#2.2.11 install /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/mdns
node-gyp rebuild
path.js:424
var path = (i >= 0) ? arguments[i] : process.cwd();
^
Error: ENOENT: no such file or directory, uv_cwd
at Error (native)
at Object.posix.resolve (path.js:424:50)
at Function.Module._resolveLookupPaths (module.js:249:17)
at Function.Module._resolveFilename (module.js:327:31)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (/usr/share/node-gyp/bin/node-gyp.js:13:11)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
npm ERR! bignum#0.11.0 install: node-gyp configure build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bignum#0.11.0 install script.
npm ERR! This is most likely a problem with the bignum package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls bignum
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.4.0-linaro-lt-qcom
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "homebridge"
npm ERR! cwd /home/linaro
npm ERR! node -v v4.2.2
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
ed25519#0.0.3 install /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/ed25519
node-gyp rebuild
I'd recommend trying your commands from a different directory. I was trying to install a specific module in
/Users/my_username/.nvm/versions/node/v8.11.3/lib/node_modules/
and it was failing with a very similar error. I moved to
/Users/my_username/.nvm/versions/
(accidentally) ran npm install and it's working now.
I also discovered npm doctor in this process, which may help you get to the bottom of your problem.

Resources