Unable to install NPM - node.js

I am trying to install NPM on a repository that I have locally cloned from GitHub. This is the error that I receive. Please let me know what I should do to resolve this.
Thank You!
npm ERR! path D:\Avin Dev\portfolio\node_modules\fibers
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node build.js || nodejs build.js
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#3.8.0
npm ERR! gyp info using node#16.14.0 | win32 | x64
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: C:\Program Files\Python38\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack File "<string>", line 1
npm ERR! gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack ^
npm ERR! gyp ERR! stack SyntaxError: invalid syntax
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:399:12)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:520:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1092:16)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! gyp ERR! System Windows_NT 10.0.22000
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Avin Dev\\portfolio\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release"
npm ERR! gyp ERR! cwd D:\Avin Dev\portfolio\node_modules\fibers
npm ERR! gyp ERR! node -v v16.14.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! node-gyp exited with code: 1
npm ERR! Please make sure you are using a supported platform and node version. If you
npm ERR! would like to compile fibers on this machine please make sure you have setup your
npm ERR! build environment--
npm ERR! Windows + OS X instructions here: https://github.com/nodejs/node-gyp
npm ERR! Ubuntu users please run: `sudo apt-get install g++ build-essential`
npm ERR! RHEL users please run: `yum install gcc-c++` and `yum groupinstall 'Development Tools'`
npm ERR! Alpine users please run: `sudo apk add python make g++`
npm ERR! 'nodejs' is not recognized as an internal or external command,
npm ERR! operable program or batch file.
npm ERR! A complete log of this run can be found in:

When a binary package is used in compatible environment, usually a precompiled binary is installed. That NPM tries to compile it is a sign that a combination Node version, CPU architecture and OS isn't supported by specified version of a binary package. fibers is a binary package known to be incompatible with Node 16.
One option is to modify the project to not depend on fibers. In the context of Vue it's likely node-sass that depends on fibers and it needs to be migrated to sass.
Another option is to downgrade to Node 14 and install the project as is.

Related

npm install error, is node-gyp mojave problem?

I can't resolve this error !! I'm getting crazy:
Here is the error:
gyp ERR! stack Error: Can't find Python executable "/path/to/python27/python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqCallback.oncomplete (fs.js:149:21)
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/Cellar/node/12.3.1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /Users/federicofrydman/Desktop/glamitGitHub/front-quiz/node_modules/fibers
gyp ERR! node -v v12.3.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-gyp exited with code: 1
This was suggested:
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: sudo apt-get install g++ build-essential
RHEL users please run: yum install gcc-c++ and yum groupinstall 'Development Tools'
Alpine users please run: sudo apk add python make g++
sh: nodejs: command not found
npm WARN ts-pnp#1.1.2 requires a peer of typescript#* but none is installed. You must install peer dependencies yourself.
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! fibers#3.1.1 install: `node build.js || nodejs build.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the fibers#3.1.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/federicofrydman/.npm/_logs/2019-07-02T03_47_12_405Z-debug.log
Using the following tools:
1.MOJAVE 10.14.5
2.XCODE 10.2.1
3.PYTHON 2.7
Issue seems to be with fibers#3.1.1 which is not supported in node version 12.
Fix it by removing my latest nodejs, 12.3.1, and installing the previous stable version of 11.
https://nodejs.org/download/release/v11.15.0/

Can’t deploy app on Ubuntu 14.04 LTS after upgrade to Meteor 1.3

Everything worked fine until Meteor 1.3 upgrade. Now I've even tried to reconfigure new Ubuntu 14.04 LTS droplet from skratch, no success. Here is what I'm doing:
Installed NodeJS 0.10.x and Mongo.
curl -sL https://deb.nodesource.com/setup_0.10 | sudo bash -
apt-get install nodejs
apt-get install mongodb-server
Built app.
meteor build --architecture os.linux.x86_64
Uploaded it to server and extracted to /home/production and tried to install dependencies.
cd /home/production/bundle/programs/server && npm install
And here we are:
> fibers#1.0.8 install
/home/production/bundle/programs/server/node_modules/fibers
> node build.js || nodejs build.js
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:43:28)
gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:46:29)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:57:16
gyp ERR! stack at Object.oncomplete (evalmachine.<anonymous>:108:15)
gyp ERR! System Linux 3.16.0-0.bpo.4-amd64
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /home/production/bundle/programs/server/node_modules/fibers
gyp ERR! node -v v0.10.43
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
Build failed
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:43:28)
gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:46:29)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:57:16
gyp ERR! stack at Object.oncomplete (evalmachine.<anonymous>:108:15)
gyp ERR! System Linux 3.16.0-0.bpo.4-amd64
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /home/production/bundle/programs/server/node_modules/fibers
gyp ERR! node -v v0.10.43
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
Build failed
npm ERR! fibers#1.0.8 install: `node build.js || nodejs build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fibers#1.0.8 install script.
npm ERR! This is most likely a problem with the fibers package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node build.js || nodejs build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls fibers
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.16.0-0.bpo.4-amd64
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! cwd /home/production/bundle/programs/server
npm ERR! node -v v0.10.43
npm ERR! npm -v 1.4.29
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
I even tried to use exact "meteor" versions of NodeJS and NPM: 0.10.43 and 2.14.22. No success. What else can I try?
So simple:
sudo apt-get install build-essential
I have no idea how could it work before 1.3 update without make. Maybe something really changed in Meteor itself in 1.3.

libtool error "no option: -static" while installing/compiling openzwave

npm install openzwave fails - compilation fails. libtool error: no option "-static"
Darwin 13.3.0 Darwin Kernel Version 13.3.0, MacBookPro11,2 Darwin
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:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Darwin 13.3.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/me/git/node-zwaveTest/node_modules/openzwave
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Darwin 13.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "instal" "openzwave"
npm ERR! node v0.10.33
npm ERR! npm v2.1.6
npm ERR! code ELIFECYCLE
npm ERR! openzwave#0.0.32 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the openzwave#0.0.32 install script.
npm ERR! This is most likely a problem with the openzwave 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 their info via:
npm ERR! npm owner ls openzwave
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/me/git/node-zwaveTest/npm-debug.log
Problem: multiple libtools installed on system. Need to use the one in /usr/bin/. Change path, or change build file depending on install mathod.
npm method
$ export PATH=/usr/local/bin:$PATH
$ npm instal openzwave
From source:
$ svn checkout http://open-zwave.googlecode.com/svn/trunk/ open-zwave-read-only
$ make (fails, but creates build directory we need)
$ vi ./cpp/build/support.mk
(Find AR := line and change libtool to /usr/bin/libtool, save, quit)
$ make
fun and profit.
Although this question is more than 18 months old now, I think you should try installing the latest OpenZWave and then try installing openzwave-shared (npm install openzwave-shared). This is a node addon (that began as a fork of the node package you're trying to install) which decouples the compilation of the underlying OpenZWave C++ library as it links to it dynamically.

Cannot install node-sass npm module

I'm attempting to install the npm module "node-sass" on my Ubuntu 14.04 distro.
When I run
node -v
I get
v0.10.32
However, when attempting to install node-sass and harp with this command:
sudo npm install -g harp
I get the following error:
child_process: customFds option is deprecated, use stdio instead.
gyp ERR! configure error
gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead
gyp ERR! stack at install (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:66:16)
gyp ERR! stack at Object.self.commands.(anonymous function) [as install] (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js:66:37)
gyp ERR! stack at getNodeDir (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:152:20)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:95:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:722:7)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at maybeClose (child_process.js:999:16)
gyp ERR! stack at Socket.<anonymous> (child_process.js:1167:11)
gyp ERR! stack at Socket.emit (events.js:107:17)
gyp ERR! stack at Pipe.close (net.js:461:12)
gyp ERR! System Linux 3.13.0-36-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/harp/node_modules/terraform/node_modules/node-sass
gyp ERR! node -v v0.13.0-pre
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
Build failed
npm ERR! node-sass#0.9.3 install: `node build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#0.9.3 install script.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.13.0-36-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "harp"
npm ERR! cwd /home/colin
npm ERR! node -v v0.13.0-pre
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/colin/npm-debug.log
npm ERR! not ok code 0
Note that the error states that my node version is still v0.13.0-pre even though I switched to 0.10.32 with nvm.
Question is 3 years old, yet I have recently encountered same problem on osx trying to install harp and found no solution elsewhere.
After several attempts managed to solve the problem with --unsafe-perm modifier, like follow:
sudo npm install --global --unsafe-perm harp
Install went successful and everything works, hope that helps :)

Error: "pre" versions of node cannot be installed, use the --nodedir flag instead

I'm trying to install opencv for node. I don't think this has anything to do with opencv directly, rather it has to do with node-gyp.
I had success in installing opencv on my mac but when I try to do the exact same on Ubuntu server I get the following error after doing 'npm install opnecv':
npm http GET https://registry.npmjs.org/opencv
npm http 304 https://registry.npmjs.org/opencv
> opencv#0.0.7 preinstall /home/demo/node_modules/opencv
> node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead
gyp ERR! stack at install (/usr/local/lib/node_modules/node-gyp/lib/install.js:69:16)
gyp ERR! stack at Object.commands.forEach.self.commands.(anonymous function) [as install] (/usr/local/lib/node_modules/node-gyp/lib/node-gyp.js:56:37)
gyp ERR! stack at getNodeDir (/usr/local/lib/node_modules/node-gyp/lib/configure.js:181:20)
gyp ERR! stack at /usr/local/lib/node_modules/node-gyp/lib/configure.js:101:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:538:7)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:96:17)
gyp ERR! stack at maybeClose (child_process.js:638:16)
gyp ERR! stack at Process._handle.onexit (child_process.js:680:5)
gyp ERR! System Linux 3.2.0-29-generic
gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/demo/node_modules/opencv
gyp ERR! node -v v0.8.13-pre
gyp ERR! node-gyp -v v0.7.1
gyp ERR! not ok
npm ERR! opencv#0.0.7 preinstall: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the opencv#0.0.7 preinstall script.
npm ERR! This is most likely a problem with the opencv 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 their info via:
npm ERR! npm owner ls opencv
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.2.0-29-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "opencv"
npm ERR! cwd /home/demo
npm ERR! node -v v0.8.13-pre
npm ERR! npm -v 1.1.63
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/demo/npm-debug.log
npm ERR! not ok code 0
I also tried downloading the source code and doing 'node-gyp rebuild' with similar results:
demo#camera:~/src/node$ node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp#0.7.1
gyp info using node#0.8.13-pre | linux | x64
gyp ERR! configure error
gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead
gyp ERR! stack at install (/usr/local/lib/node_modules/node-gyp/lib/install.js:69:16)
gyp ERR! stack at Object.commands.forEach.self.commands.(anonymous function) [as install] (/usr/local/lib/node_modules/node-gyp/lib/node-gyp.js:56:37)
gyp ERR! stack at getNodeDir (/usr/local/lib/node_modules/node-gyp/lib/configure.js:181:20)
gyp ERR! stack at /usr/local/lib/node_modules/node-gyp/lib/configure.js:101:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:538:7)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:96:17)
gyp ERR! stack at maybeClose (child_process.js:638:16)
gyp ERR! stack at Process._handle.onexit (child_process.js:680:5)
gyp ERR! System Linux 3.2.0-29-generic
gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/demo/src/node
gyp ERR! node -v v0.8.13-pre
gyp ERR! node-gyp -v v0.7.1
gyp ERR! not ok
Has anyone had this issue before?
I was also able to solve this by upgrading my version of node to a stable version (e.g. not a "pre" version - your version is 0.8.13-pre) with the following:
sudo npm install -g n # install node version manager "n"
sudo n stable # install the latest stable version of node
Use npm install --nodedir=/path/to/node opencv, where /path/to/node is a path to current nodejs source code.
It happens because node-gyp can't find source to your custom build, and here is the discussion about it: https://github.com/TooTallNate/node-gyp/issues/86
You can commonly fix this by creating a symbolic link if you have super user permissions.
chmod a+r /path/to/node -R
cd /usr/lib
sudo ln -s /path/to/node node
Then npm install again, and it will likely find it. Don't do this if /usr/lib/node already exists, as other software may depend on it.

Resources