Version info :
node#4.6.0
node-gyp#3.4.0
npm#2.15.9
I try to install the following dependencies :
"canvas": "^1.1.6",
"exec-sync": "^0.1.6",
"fabric": "^1.6.0",
"request": "^2.67.0",
"word": "^0.2.4"
So i do an npm install the following dependencies are installed:
"canvas": "^1.1.6",
"fabric": "^1.6.0",
"request": "^2.67.0",
"word": "^0.2.4"
But the exec-sync delivers the following error:
1443 verbose stack Error: ffi#1.2.5 install: `node-gyp rebuild`
1443 verbose stack Exit status 1
1443 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:217:16)
1443 verbose stack at emitTwo (events.js:87:13)
1443 verbose stack at EventEmitter.emit (events.js:172:7)
1443 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:24:14)
1443 verbose stack at emitTwo (events.js:87:13)
1443 verbose stack at ChildProcess.emit (events.js:172:7)
1443 verbose stack at maybeClose (internal/child_process.js:829:16)
1443 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
Im a litte bit lost at this point, i tried the following things:
Deleted all the node_modules and tried an fresh install;
Tried installing the modules seperately;
Is it a version problem of node.js vs the exec-sync build?, im lost.
I fixed it!
CD to node_modules
git clone https://github.com/jeremyfa/node-exec-sync edit
open node-exec-sync/package.json to remove the ffi dependency line
npm install ./node-exec-sync
Here are the steps I followed as a workaround to npm install for testing:
removed exec-sync dependency from package.json
npm install ffi (installs latest version ok)
git clone https://github.com/jeremyfa/node-exec-sync
edit node-exec-sync/package.json to remove the ffi dependency line
npm install ./node-exec-sync then npm install finished ok
Don't use node-exec-sync, it's very difficult to install, on every OS that I've tried, for different reasons.
Instead, use https://www.npmjs.com/package/cross-spawn , which doesn't have any of these unbuildable native dependencies. It's basically an all-around better replacement for node-exec-sync or the built-in child_process APIs.
Related
I the Node.js package apiconnect will not install on my new MacBook Pro. The Node.js version is v10.22.1, NPM version 6.14.6, Python 3.8.3
I ran the following command:
sudo npm install -g --unsafe-perm=true --allow-root --loglevel verbose apiconnect
The error that I receive is similar to what I received in the container (appmetrics#3.1.3). The error from the log:
61922 silly install appmetrics#3.1.3
61923 info lifecycle appmetrics#3.1.3~install: appmetrics#3.1.3
61924 verbose lifecycle appmetrics#3.1.3~install: unsafe-perm in lifecycle true
61925 verbose lifecycle appmetrics#3.1.3~install: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/local/lib/node_modules/apiconnect/node_modules/appmetrics/node_modules/.bin:/usr/local/lib/node_modules/apiconnect/node_modules/.bin:/usr/local/lib/node_modules/.bin:/Users/steve/opt/anaconda3/bin:/Users/steve/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
61926 verbose lifecycle appmetrics#3.1.3~install: CWD: /usr/local/lib/node_modules/apiconnect/node_modules/appmetrics
61927 silly lifecycle appmetrics#3.1.3~install: Args: [ '-c', 'node extract_all_binaries.js || node-gyp rebuild' ]
61928 silly lifecycle appmetrics#3.1.3~install: Returned: code: 1 signal: null
61929 info lifecycle appmetrics#3.1.3~install: Failed to exec install script
61930 timing action:install Completed in 26347ms
61931 verbose unlock done using /Users/steve/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
61932 timing stage:rollbackFailedOptional Completed in 8528ms
61933 timing stage:runTopLevelLifecycles Completed in 468567ms
61934 verbose stack Error: appmetrics#3.1.3 install: `node extract_all_binaries.js || node-gyp rebuild`
61934 verbose stack Exit status 1
61934 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
61934 verbose stack at EventEmitter.emit (events.js:198:13)
61934 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
61934 verbose stack at ChildProcess.emit (events.js:198:13)
61934 verbose stack at maybeClose (internal/child_process.js:982:16)
61934 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
61935 verbose pkgid appmetrics#3.1.3
61936 verbose cwd /Users/steve
61937 verbose Darwin 19.6.0
61938 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "--unsafe-perm=true" "--allow-root" "--loglevel" "verbose" "apiconnect"
61939 verbose node v10.22.1
61940 verbose npm v6.14.6
61941 error code ELIFECYCLE
61942 error errno 1
61943 error appmetrics#3.1.3 install: `node extract_all_binaries.js || node-gyp rebuild`
61943 error Exit status 1
61944 error Failed at the appmetrics#3.1.3 install script.
61944 error This is probably not a problem with npm. There is likely additional logging output above.
61945 verbose exit [ 1, true ]
Does this work?
npm i -g node-gyp#latest && npm config set node_gyp "/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js"
node-gyp rebuild
The issue was resolved by changing the order of the directories in my PATH environment variable and running the install as sudo and using the --unsafe-perm=true and --allow-root options.
The full command used for the installation was:
sudo npm install -g --unsafe-perm=true --allow-root --loglevel verbose apiconnect
For the PATH environment variable, the installation of anaconda3 Python/Jupyter Notebook package put their directories at the front of the path. By changing the path to so that:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:...
where the first directories in the path, the installation worked.
Attempted NodeJS versions:
13.13.0
12.16.2
8.10.0
npm version: 6.14.4
Followed: https://askubuntu.com/questions/677498/unable-to-install-latest-nodejs-version-on-ubuntu-14-04
and typed:
curl -sL https://deb.nodesource.com/setup_0.13 | sudo bash -
sudo apt-get install -y nodejs
301 verbose stack Error: canvas#2.6.1 install: `node-pre-gyp install --fallback-to-build`
301 verbose stack Exit status 1
301 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
301 verbose stack at EventEmitter.emit (events.js:315:20)
301 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
301 verbose stack at ChildProcess.emit (events.js:315:20)
301 verbose stack at maybeClose (internal/child_process.js:1026:16)
301 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
302 verbose pkgid canvas#2.6.1
303 verbose cwd /home/2PG
304 verbose Linux 4.15.0-88-generic
305 verbose argv "/usr/bin/node" "/usr/bin/npm" "update"
306 verbose node v13.13.0
307 verbose npm v6.14.4
308 error code ELIFECYCLE
309 error errno 1
310 error canvas#2.6.1 install: `node-pre-gyp install --fallback-to-build`
310 error Exit status 1
311 error Failed at the canvas#2.6.1 install script.
311 error This is probably not a problem with npm. There is likely additional logging output above.
312 verbose exit [ 1, true ]
Full Log: https://pastebin.com/V3N14w5p
When I type sudo apt-get install npm:
Steps to reproduce:
1) Create new DigitalOcean NodeJS droplet (v8.10.0)
2) Drag and drop https://github.com/theADAMJR/2PG using FileZilla
3) Go to the folder and type npm i
It's a known issue. That version of Node is not supported. I suggest you use 12.x.
If you want to use 13.x. I was able to install it correctly on 13.1.0, otherwise you'll need to wait until they update the package to support the version of node you want to use, this is a common issue with all native addons.
Ive been looking online for a solution to installing node-sass on my plesk server. I read that this is kind of a no no as this should not be done on a production server(dont care - not a live site).
I have uploaded the documents via bitbucket and click the NPM install button. The result is the failure below:
3822 verbose stack Error: node-sass#4.12.0 install: `node scripts/install.js`
3822 verbose stack spawn ENOENT
3822 verbose stack at ChildProcess.<anonymous> (/opt/plesk/node/9/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
3822 verbose stack at ChildProcess.emit (events.js:180:13)
3822 verbose stack at maybeClose (internal/child_process.js:936:16)
3822 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
3823 verbose pkgid node-sass#4.12.0
3824 verbose cwd /var/www/vhosts/mjmnagy.info/app
3825 verbose Linux 3.10.0-862.9.1.el7.x86_64
3826 verbose argv "/opt/plesk/node/9/bin/node" "/opt/plesk/node/9/bin/npm" "install"
3827 verbose node v9.10.1
3828 verbose npm v5.6.0
3829 error file sh
3830 error code ELIFECYCLE
3831 error errno ENOENT
3832 error syscall spawn
3833 error node-sass#4.12.0 install: `node scripts/install.js`
3833 error spawn ENOENT
3834 error Failed at the node-sass#4.12.0 install script.
3834 error This is probably not a problem with npm. There is likely additional logging output above.
3835 verbose exit [ 1, true ]
I attempted to login to the server using SSH but for the life of me couldn't figure out how to install it.
Using SSH, i navigated to where node is install (/opt/plesk/node/7/bin/) trying 6/7/8 and then running npm. i always got unrecognized command.
I then realized that the version i have of node-sass was higher than the node version install on the server(9.10.1)
What do i need to do to be able to install the module?
ignore plesks NPM install button and create a script in your package.json
"installme": "npm i --unsafe-perms"
Using plesk run the script
installme --scripts-node-prepend-path
Problem
Failed at the ffmpeg-binaries#4.0.0 install script 'node install'
How I do it
npm i ffmpeg-binaries
Environment
Ubuntu 14 on VDS
Node v6.0.0
NVM v3.8.6
Last string of npm-debug
9491 silly rollbackFailedOptional Starting
9492 silly rollbackFailedOptional Finishing
9493 silly runTopLevelLifecycles Starting
9494 silly runTopLevelLifecycles Finishing
9495 silly install printInstalled
9496 warn root#1.0.0 No description
9497 warn root#1.0.0 No repository field.
9498 verbose stack Error: ffmpeg-binaries#4.0.0 install: `node install`
9498 verbose stack Exit status 137
9498 verbose stack at EventEmitter.<anonymous> (/root/.nvm/versions/node/v6.0.0/lib/node_modules/npm/lib/utils/lifecycle.js:239:16)
9498 verbose stack at emitTwo (events.js:106:13)
9498 verbose stack at EventEmitter.emit (events.js:191:7)
9498 verbose stack at ChildProcess.<anonymous> (/root/.nvm/versions/node/v6.0.0/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9498 verbose stack at emitTwo (events.js:106:13)
9498 verbose stack at ChildProcess.emit (events.js:191:7)
9498 verbose stack at maybeClose (internal/child_process.js:850:16)
9498 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
9499 verbose pkgid ffmpeg-binaries#4.0.0
9500 verbose cwd /root
9501 error Linux 2.6.32-042stab127.2
9502 error argv "/root/.nvm/versions/node/v6.0.0/bin/node" "/root/.nvm/versions/node/v6.0.0/bin/npm" "i" "ffmpeg-binaries"
9503 error node v6.0.0
9504 error npm v3.8.6
9505 error code ELIFECYCLE
9506 error ffmpeg-binaries#4.0.0 install: `node install`
9506 error Exit status 137
9507 error Failed at the ffmpeg-binaries#4.0.0 install script 'node install'.
9507 error Make sure you have the latest version of node.js and npm installed.
9507 error If you do, this is most likely a problem with the ffmpeg-binaries package,
9507 error not with npm itself.
9507 error Tell the author that this fails on your system:
9507 error node install
9507 error You can get information on how to open an issue for this project with:
9507 error npm bugs ffmpeg-binaries
9507 error Or if that isn't available, you can get their info via:
9507 error npm owner ls ffmpeg-binaries
9507 error There is likely additional logging output above.
9508 verbose exit [ 1, true ]
I have also recently been having this error, but I have since solved it. The thing you need to do is use the command:
npm install ffbinaries
instead of using ffmpeg-binaries.
The reason for this is because the binaries were originally created for ubuntu linux. Hope this helps! :)
This issue doesn't seem to be the case with all of my projects, one in particular gives this issue when I run npm i (node v6.9.4 (npm v5.6.0) <- also not sure if this is right):
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__threading_support:25:11: fatal error:
'pthread.h' file not found
# include <pthread.h>
The error log:
12788 verbose stack Error: farmhash#1.2.1 install: `node-gyp rebuild`
12788 verbose stack Exit status 1
12788 verbose stack at EventEmitter.<anonymous> (/Users/tom.firth/.nvm/versions/node/v6.9.4/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
12788 verbose stack at emitTwo (events.js:106:13)
12788 verbose stack at EventEmitter.emit (events.js:191:7)
12788 verbose stack at ChildProcess.<anonymous> (/Users/tom.firth/.nvm/versions/node/v6.9.4/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
12788 verbose stack at emitTwo (events.js:106:13)
12788 verbose stack at ChildProcess.emit (events.js:191:7)
12788 verbose stack at maybeClose (internal/child_process.js:877:16)
12788 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
12789 verbose pkgid farmhash#1.2.1
12790 verbose cwd /Users/tom.firth/Sites/the-works
12791 verbose Darwin 16.7.0
12792 verbose argv "/Users/tom.firth/.nvm/versions/node/v6.9.4/bin/node" "/Users/tom.firth/.nvm/versions/node/v6.9.4/bin/npm" "i"
12793 verbose node v6.9.4
12794 verbose npm v5.6.0
12795 error code ELIFECYCLE
12796 error errno 1
12797 error farmhash#1.2.1 install: `node-gyp rebuild`
12797 error Exit status 1
12798 error Failed at the farmhash#1.2.1 install script.
12798 error This is probably not a problem with npm. There is likely additional logging output above.
12799 verbose exit [ 1, true ]
Both of these point to node-gyp rebuild - I haven't had this installed globally before, but i've tried it with and without and get the same error.
I have xcode 9.1 installed and ran:
$ xcode-select --install
which gives: xcode-select: error: command line tools are already installed, use "Software Update" to install updates
I followed the steps in: npmjs.com/fixing-npm-permissions
$ gcc --version
which gives:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.38)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$ which gcc
which gives:
/usr/bin/gcc
The node-gyp issue makes me think it's related to the compiler but I have reinstalled xcode and node (via brew and nodejs.org)
Any help or suggestions would be really appreciated.
edit:
I have tried npm 3.10.10 because 5.6.0 obviously wasn't right. This was previously installed and didn't resolve the issue.
I installed xcode 8.2.1 to replace xcode 9.1, this didn't resolve the issue.
You basically need to install libtool to make it work. This was same issue I had when I was using bcrypt. If that doesn't seems to work you should have a look at this.
Also please check which version of python is installed supported version is 2.7 the latest 3.x is not supported yet as per node-gyp documentation. This node Js Workshop discuss more details about the gyp this should be of some help too.
I'm not entirely sure what the solution was.
I installed xcode 8.2.1 (down from 9.1). I had tried this before but
Initially this didn't work.
I then installed the commandlinetools manually (not via
xcode-select --install) (Library/Developer/CommandLineTools
didn't exist before or after this installation) - xcode-select -p
changed its path from pointing to xcode to commandlinetools even
though the dir didn't exist.
I then installed Xcode8.2.1 again, xcode-select's path automatically
changed without a reset (xcode-select --reset)
After this, my issue was resolved.