Node-Gyp is failing


#1

I’m on Ubuntu 14.04 64 bit. I have the dependencies installed. I’m using Node through nvm and have v0.10.28 with npm at 1.4.9 and node-gyp at v0.13.0. My python is 2.7.6. I have ran npm config set python /usr/bin/python2.7 -g. When I run npm install within the atom directory I’m receiving node-gyp errors. They are

> atom@0.95.0 preinstall /home/dalton/Github/atom
> node -e 'process.exit(0)'

npm http GET https://registry.npmjs.org/git-utils
npm http GET https://registry.npmjs.org/nslog
npm http GET https://registry.npmjs.org/pathwatcher
npm http GET https://registry.npmjs.org/oniguruma
npm http GET https://registry.npmjs.org/runas
npm http GET https://registry.npmjs.org/scrollbar-style
npm http 304 https://registry.npmjs.org/git-utils
npm http 304 https://registry.npmjs.org/scrollbar-style
npm http 304 https://registry.npmjs.org/runas
npm http 304 https://registry.npmjs.org/pathwatcher
npm http 304 https://registry.npmjs.org/nslog
npm http 304 https://registry.npmjs.org/oniguruma
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/nan
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/bindings

> scrollbar-style@0.4.0 install /home/dalton/Github/atom/node_modules/scrollbar-style
> node-gyp rebuild

Usage: gyp_main.py [options ...] [build_file ...]

gyp_main.py: error: no such option: --no-parallel
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onCpExit (/home/dalton/.nvm/v0.10.28/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:340:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:807:12)
gyp ERR! System Linux 3.13.0-24-generic
gyp ERR! command "node" "/home/dalton/.nvm/v0.10.28/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/dalton/Github/atom/node_modules/scrollbar-style
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok 
npm http 200 https://registry.npmjs.org/async

> nslog@0.5.0 install /home/dalton/Github/atom/node_modules/nslog
> node-gyp rebuild


Usage: gyp_main.py [options ...] [build_file ...]

gyp_main.py: error: no such option: --no-parallel
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onCpExit (/home/dalton/.nvm/v0.10.28/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:340:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:807:12)
gyp ERR! System Linux 3.13.0-24-generic
gyp ERR! command "node" "/home/dalton/.nvm/v0.10.28/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/dalton/Github/atom/node_modules/nslog
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok 
npm ERR! scrollbar-style@0.4.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the scrollbar-style@0.4.0 install script.
npm ERR! This is most likely a problem with the scrollbar-style 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 scrollbar-style
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.13.0-24-generic
npm ERR! command "/home/dalton/.nvm/v0.10.28/bin/node" "/home/dalton/.nvm/v0.10.28/bin/npm" "install"
npm ERR! cwd /home/dalton/Github/atom
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE

> oniguruma@1.0.6 install /home/dalton/Github/atom/node_modules/oniguruma
> node-gyp rebuild

Usage: gyp_main.py [options ...] [build_file ...]

gyp_main.py: error: no such option: --no-parallel
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onCpExit (/home/dalton/.nvm/v0.10.28/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:340:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:807:12)
gyp ERR! System Linux 3.13.0-24-generic
gyp ERR! command "node" "/home/dalton/.nvm/v0.10.28/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/dalton/Github/atom/node_modules/oniguruma
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok 

> runas@0.5.4 install /home/dalton/Github/atom/node_modules/runas
> node-gyp rebuild

Usage: gyp_main.py [options ...] [build_file ...]

gyp_main.py: error: no such option: --no-parallel
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onCpExit (/home/dalton/.nvm/v0.10.28/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:340:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:807:12)
gyp ERR! System Linux 3.13.0-24-generic
gyp ERR! command "node" "/home/dalton/.nvm/v0.10.28/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/dalton/Github/atom/node_modules/runas
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok 

> pathwatcher@1.2.4 install /home/dalton/Github/atom/node_modules/pathwatcher
> node-gyp rebuild

Usage: gyp_main.py [options ...] [build_file ...]

gyp_main.py: error: no such option: --no-parallel
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onCpExit (/home/dalton/.nvm/v0.10.28/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:340:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:807:12)
gyp ERR! System Linux 3.13.0-24-generic
gyp ERR! command "node" "/home/dalton/.nvm/v0.10.28/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/dalton/Github/atom/node_modules/pathwatcher
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok 

> git-utils@1.3.0 install /home/dalton/Github/atom/node_modules/git-utils
> node-gyp rebuild

Usage: gyp_main.py [options ...] [build_file ...]

gyp_main.py: error: no such option: --no-parallel
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onCpExit (/home/dalton/.nvm/v0.10.28/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:340:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:807:12)
gyp ERR! System Linux 3.13.0-24-generic
gyp ERR! command "node" "/home/dalton/.nvm/v0.10.28/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/dalton/Github/atom/node_modules/git-utils
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok 
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/dalton/Github/atom/npm-debug.log
npm ERR! not ok code 0

Any idea on how I fix this and build atom successfully?


Building on Ubuntu 14.04: gyp_main.py: error: no such option: --no-parallel
Atom install on arch failed
#2

Did you check how others fixed this?


#3

Thanks, I had done some googling but hadn’t noticed the Github issue search.


#4

It is very useful for this kind of issues, did you find what is wrong with node-gyp yet?

I’ve read that the official nodejs repo is causing some errors with node-gyp, you need to use ppa:chris-lea


#5

I got the same problem: node-gyp rebuild crashes and a package that uses node-gyp can’t be installed. It’s autocomplete-clang. Unfortunately the fixes don’t work for me:

  1. I removed atom and nodejs and reinstalled the newest versions of each (nodejs from source). The error is still there
  2. I installed node-gyp and runas with npm. The error is still there.
  3. I removed everything and installed it from the chris-lea ppa. The error persists
  4. I removed everything, added the deadsnakes ppa, set my python to the old 2.6 version, and checked which version is run by the python command in the terminal - its 2.6. Then I reinstalled nodejs from source. Set the python path to 2.6 with npm config. And reinstalled node-gyp. The error is still there.
  5. I removed everything, except for the old python setup. And installed nodejs from the chris-lea ppa. Same problem.

Between each step I did an npm cache clean and reinstalled the newest version of atom.

node-gyp rebuild in my atom packages directory fails each time. And I can’t install the autocomplete-clang package. Same error.
The error message suggests a problem with runas. Therefore, in each step I also installed runas via npm.

This is really burning a lot of time. I’m new to nodejs and all out of ideas. What can I do ?

Here’s the apm output:

Installing autocomplete-clang to /home/lars/.atom/packages ✗

> runas@1.0.1 install /tmp/apm-install-dir-11499-22706-1lgjxbx/node_modules/autocomplete-clang/node_modules/clang-flags/node_modules/pathwatcher/node_modules/runas
> node-gyp rebuild


> runas@0.5.4 install /tmp/apm-install-dir-11499-22706-1lgjxbx/node_modules/autocomplete-clang/node_modules/snippets/node_modules/pathwatcher/node_modules/runas
> node-gyp rebuild


npm http GET https://registry.npmjs.org/underscore-plus
npm http GET https://registry.npmjs.org/clang-flags
npm http 304 https://registry.npmjs.org/underscore-plus
npm http 304 https://registry.npmjs.org/clang-flags
npm http GET https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/pathwatcher
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/emissary
npm http GET https://registry.npmjs.org/loophole
npm http GET https://registry.npmjs.org/fs-plus
npm http GET https://registry.npmjs.org/pathwatcher
npm http GET https://registry.npmjs.org/pegjs
npm http GET https://registry.npmjs.org/season
npm http GET https://registry.npmjs.org/temp
npm http 304 https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/fs-plus
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/pegjs
npm http 304 https://registry.npmjs.org/season
npm http 304 https://registry.npmjs.org/pathwatcher
npm http 304 https://registry.npmjs.org/pathwatcher
npm http GET https://registry.npmjs.org/emissary
npm http GET https://registry.npmjs.org/event-kit
npm http 304 https://registry.npmjs.org/temp
npm http GET https://registry.npmjs.org/nan/1.2.0
npm http GET https://registry.npmjs.org/grim
npm http GET https://registry.npmjs.org/q
npm http GET https://registry.npmjs.org/runas
npm http 304 https://registry.npmjs.org/emissary
npm http 304 https://registry.npmjs.org/emissary
npm http 304 https://registry.npmjs.org/nan/1.2.0
npm http 304 https://registry.npmjs.org/q
npm http 304 https://registry.npmjs.org/runas
npm http 304 https://registry.npmjs.org/grim
npm http 304 https://registry.npmjs.org/event-kit
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/rimraf
gyp ERR! configure error 
gyp ERR! stack Error: EACCES, mkdir '/tmp/apm-install-dir-11499-22706-1lgjxbx/node_modules/autocomplete-clang/node_modules/clang-flags/node_modules/pathwatcher/node_modules/runas/build'
gyp ERR! System Linux 3.13.0-36-generic
gyp ERR! command "node" "/usr/local/share/atom/resources/app/apm/node_modules/atom-package-manager/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/apm-install-dir-11499-22706-1lgjxbx/node_modules/autocomplete-clang/node_modules/clang-flags/node_modules/pathwatcher/node_modules/runas
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok 
npm http GET https://registry.npmjs.org/mixto
npm http GET https://registry.npmjs.org/property-accessors
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/loophole
npm ERR! runas@1.0.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the runas@1.0.1 install script.
npm ERR! This is most likely a problem with the runas 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 runas
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.13.0-36-generic
npm ERR! command "/usr/local/share/atom/resources/app/apm/node_modules/atom-package-manager/bin/node" "/usr/local/share/atom/resources/app/apm/node_modules/atom-package-manager/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/usr/local/share/atom/resources/app/apm/node_modules/atom-package-manager/.apmrc" "--userconfig" "/home/lars/.atom/.apmrc" "install" "/home/lars/.atom/.node-gyp/.atom/.apm/autocomplete-clang/0.2.0/package.tgz" "--target=0.11.10" "--arch=x64"
npm ERR! cwd /tmp/apm-install-dir-11499-22706-1lgjxbx
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.4
npm ERR! code ELIFECYCLE
npm http 304 https://registry.npmjs.org/property-accessors
npm http GET https://registry.npmjs.org/coffee-script
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/osenv/0.0.3
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/nan/0.8.0
npm http 304 https://registry.npmjs.org/osenv/0.0.3
npm http GET https://registry.npmjs.org/graceful-fs
npm http 200 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/coffee-script
npm http GET https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/nan/0.8.0
gyp ERR! configure error 
gyp ERR! stack Error: EACCES, mkdir '/tmp/apm-install-dir-11499-22706-1lgjxbx/node_modules/autocomplete-clang/node_modules/snippets/node_modules/pathwatcher/node_modules/runas/build'
gyp ERR! System Linux 3.13.0-36-generic
gyp ERR! command "node" "/usr/local/share/atom/resources/app/apm/node_modules/atom-package-manager/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/apm-install-dir-11499-22706-1lgjxbx/node_modules/autocomplete-clang/node_modules/snippets/node_modules/pathwatcher/node_modules/runas
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok 
npm http 304 https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/mixto
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /tmp/apm-install-dir-11499-22706-1lgjxbx/npm-debug.log
npm ERR! not ok code 0

#6

let’s try apt-get remove gyp
and npm install again
reference:


#7

I have same issue, i was looking for a solution for a long time but have not found any

`C:\Users\orest.atom.apm>apm install term2
Installing term2 to C:\Users\orest.atom\packages failed

pty.js@0.2.13 install C:\Users\orest\AppData\Local\Temp\apm-install-dir-11665-6728-sdl01u\node_modules\term2\node_modules\pty.js
node-gyp rebuild

C:\Users\orest\AppData\Local\Temp\apm-install-dir-11665-6728-sdl01u\node_modules\term2\node_modules\pty.js>if not defined npm_config_node_gyp (node “C:\Users\orest\AppData\Local\atom\app-1.8.0\resourc
es\app\apm\node_modules\npm\bin\node-gyp-bin\…\node_modules\node-gyp\bin\node-gyp.js” rebuild ) else (node rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the “/m” switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component “VCBuild.exe”. To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of th
e component to the system path if it is installed elsewhere. [C:\Users\orest\AppData\Local\Temp\apm-install-dir-11665-6728-sdl01u\node_modules\term2\node_modules\pty.js\build\binding.sln]
MSBUILD : error MSB3428: Could not load the Visual C++ component “VCBuild.exe”. To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of th
e component to the system path if it is installed elsewhere. [C:\Users\orest\AppData\Local\Temp\apm-install-dir-11665-6728-sdl01u\node_modules\term2\node_modules\pty.js\build\binding.sln]

gypnpm ERR! Windows_NT 6.1.7601
npm ERR! argv “C:\Users\orest\AppData\Local\atom\app-1.8.0\resources\app\apm\bin\node.exe” “C:\Users\orest\AppData\Local\atom\app-1.8.0\resources\app\apm\node_modules\npm\bin\n
pm-cli.js” “–globalconfig” “C:\Users\orest\.atom\.apm\.apmrc” “–userconfig” “C:\Users\orest\.atom\.apmrc” “install” “C:\Users\orest\AppData\Local\Temp\d-11665-6728-t8gise\package.tgz
” “–target=0.36.8” "–arch=ia32"
npm ERR! node v0.10.40
npm ERR! npm v2.13.3
npm ERR! code ELIFECYCLE

npm ERR! pty.js@0.2.13 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pty.js@0.2.13 install script ‘node-gyp rebuild’.
npm ERR! This is most likely a problem with the pty.js 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 pty.js
npm ERR! There is likely additional logging output above.`

here is my output. any ideas?


#8

This right here is what’s wrong.


#9

On the Mac, I solved for this issue by finding where apm was installed (on my machine, MacOSX Sierra: /Applications/Atom.app/Contents/Resources/app/apm/bin), then running: ./apm config set python /usr/bin/python2.7 in that folder. This command sets the python config for the apm program installed with atom, and doesn’t mess with your global node setup. Or for copy/paste convenience:

cd /Applications/Atom.app/Contents/Resources/app/apm/bin
./apm config set python /usr/bin/python2.7