Skip to content

trying to 'npm install', getting node-gyp rebuild errors #809

Closed

Description

@brascosDad
ernestscomputer:musicomp ernest son$ npm install

> bufferutil@1.2.1 install /Users/ernest son/Desktop/PROJECTS/musicomp/node_modules/bufferutil
> node-gyp rebuild

  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
clang: error: no such file or directory: 'son/.node-gyp/5.0.0/include/node'
clang: error: no such file or directory: 'son/.node-gyp/5.0.0/src'
clang: error: no such file or directory: 'son/.node-gyp/5.0.0/deps/uv/include'
clang: error: no such file or directory: 'son/.node-gyp/5.0.0/deps/v8/include'
make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Error 1
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 Darwin 14.5.0
gyp ERR! command "/usr/local/Cellar/node/5.0.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/ernest son/Desktop/PROJECTS/musicomp/node_modules/bufferutil
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
npm WARN install:bufferutil@1.2.1 bufferutil@1.2.1 install: `node-gyp rebuild`
npm WARN install:bufferutil@1.2.1 Exit status 1

> utf-8-validate@1.2.1 install /Users/ernest son/Desktop/PROJECTS/musicomp/node_modules/utf-8-validate
> node-gyp rebuild

  CXX(target) Release/obj.target/validation/src/validation.o
clang: error: no such file or directory: 'son/.node-gyp/5.0.0/include/node'
clang: error: no such file or directory: 'son/.node-gyp/5.0.0/src'
clang: error: no such file or directory: 'son/.node-gyp/5.0.0/deps/uv/include'
clang: error: no such file or directory: 'son/.node-gyp/5.0.0/deps/v8/include'
make: *** [Release/obj.target/validation/src/validation.o] Error 1
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 Darwin 14.5.0
gyp ERR! command "/usr/local/Cellar/node/5.0.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/ernest son/Desktop/PROJECTS/musicomp/node_modules/utf-8-validate
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
npm WARN install:utf-8-validate@1.2.1 utf-8-validate@1.2.1 install: `node-gyp rebuild`
npm WARN install:utf-8-validate@1.2.1 Exit status 1

Activity

  1. brascosDad commented on Nov 9, 2015

    @brascosDad
    Author

    back story: in trying to uninstall iojs and reinstall node, I entered a world of shizzao but finally got node and npm installed successfully....I tried installing node-gyp globally to no avail...

  2. bnoordhuis commented on Nov 9, 2015

    @bnoordhuis
    Member

    Delete your $HOME/.node-gyp directory and try again.

    Aside, many tools don't handle spaces in path names well (/Users/ernest son/...).

  3. brascosDad commented on Nov 9, 2015

    @brascosDad
    Author

    sorry, when you say "$home" do you essentially mean usr/local/bin? that's what "which node-gyp" yields in term...or do you mean another location?

    I did change my user name by eliminating space for "_". thanks for the heads up

  4. bnoordhuis commented on Nov 9, 2015

    @bnoordhuis
    Member

    I mean the HOME environment variable. :-) node-gyp normally downloads the development tarballs to $HOME/.node-gyp, i.e., /home/username/.node-gyp or /Users/username/.node-gyp.

  5. brascosDad commented on Nov 9, 2015

    @brascosDad
    Author

    thanks, i figured out what you meant....just tried npm install and it appears i still have rebuild issues. it looks as though my user rename didn't propogate..(?)

    > bufferutil@1.2.1 install /Users/ernest son/Desktop/PROJECTS/musicomp/node_modules/bufferutil
    > node-gyp rebuild
    
      CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
    clang: error: no such file or directory: 'son/.node-gyp/5.0.0/include/node'
    clang: error: no such file or directory: 'son/.node-gyp/5.0.0/src'
    clang: error: no such file or directory: 'son/.node-gyp/5.0.0/deps/uv/include'
    clang: error: no such file or directory: 'son/.node-gyp/5.0.0/deps/v8/include'
    make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Error 1
    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 Darwin 14.5.0
    gyp ERR! command "/usr/local/Cellar/node/5.0.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /Users/ernest son/Desktop/PROJECTS/musicomp/node_modules/bufferutil
    gyp ERR! node -v v5.0.0
    gyp ERR! node-gyp -v v3.0.3
    gyp ERR! not ok 
    npm WARN install:bufferutil@1.2.1 bufferutil@1.2.1 install: `node-gyp rebuild`
    npm WARN install:bufferutil@1.2.1 Exit status 1
    
    > utf-8-validate@1.2.1 install /Users/ernest son/Desktop/PROJECTS/musicomp/node_modules/utf-8-validate
    > node-gyp rebuild
    
      CXX(target) Release/obj.target/validation/src/validation.o
    clang: error: no such file or directory: 'son/.node-gyp/5.0.0/include/node'
    clang: error: no such file or directory: 'son/.node-gyp/5.0.0/src'
    clang: error: no such file or directory: 'son/.node-gyp/5.0.0/deps/uv/include'
    clang: error: no such file or directory: 'son/.node-gyp/5.0.0/deps/v8/include'
    make: *** [Release/obj.target/validation/src/validation.o] Error 1
    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 Darwin 14.5.0
    gyp ERR! command "/usr/local/Cellar/node/5.0.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /Users/ernest son/Desktop/PROJECTS/musicomp/node_modules/utf-8-validate
    gyp ERR! node -v v5.0.0
    gyp ERR! node-gyp -v v3.0.3
    gyp ERR! not ok 
    npm WARN install:utf-8-validate@1.2.1 utf-8-validate@1.2.1 install: `node-gyp rebuild`
    npm WARN install:utf-8-validate@1.2.1 Exit status 1
    musiComp@1.0.0 /Users/ernest son/Desktop/PROJECTS/musicomp
    ├─┬ gulp@3.9.0
    │ └─┬ vinyl-fs@0.3.14
    │   └─┬ through2@0.6.5
    │     └── readable-stream@1.0.33 
    ├─┬ gulp-clean@0.3.1
    │ ├─┬ gulp-util@2.2.20
    │ │ └─┬ through2@0.5.1
    │ │   ├── readable-stream@1.0.33 
    │ │   └── xtend@3.0.0 
    │ └─┬ through2@0.4.2
    │   └── readable-stream@1.0.33 
    ├─┬ gulp-concat@2.6.0
    │ └─┬ through2@0.6.5
    │   └── readable-stream@1.0.33 
    ├─┬ gulp-cssmin@0.1.7
    │ └─┬ gulp-util@2.2.20
    │   └─┬ through2@0.5.1
    │     ├── readable-stream@1.0.33 
    │     └── xtend@3.0.0 
    ├─┬ gulp-jshint@1.12.0
    │ └─┬ through2@0.6.5
    │   └── readable-stream@1.0.33 
    ├─┬ gulp-karma@0.0.5
    │ ├─┬ gulp-util@2.2.20
    │ │ └─┬ through2@0.5.1
    │ │   ├── readable-stream@1.0.33 
    │ │   └── xtend@3.0.0 
    │ └─┬ optimist@0.6.1
    │   └── minimist@0.0.10 
    ├─┬ gulp-ruby-sass@2.0.5
    │ └─┬ vinyl-fs@1.0.0
    │   └─┬ through2@0.6.5
    │     └── readable-stream@1.0.33 
    ├─┬ karma@0.13.14
    │ ├─┬ chokidar@1.2.0
    │ │ └─┬ fsevents@1.0.5
    │ │   └─┬ node-pre-gyp@0.6.15
    │ │     └─┬ tar-pack@3.1.0
    │ │       └── readable-stream@1.0.33 
    │ └─┬ log4js@0.6.27
    │   └── readable-stream@1.0.33 
    └─┬ phantomjs@1.9.18
      └─┬ request@2.42.0
        └─┬ bl@0.9.4
          └── readable-stream@1.0.33 
    
  6. bnoordhuis commented on Nov 9, 2015

    @bnoordhuis
    Member

    Maybe you need to log out and log in again? It's also possible that $HOME/.npmrc has some outdated variables.

  7. brascosDad commented on Nov 9, 2015

    @brascosDad
    Author

    so redelete $HOME/.node-gyp and also .npmrc? logout and try again? I already restarted after user name change...

  8. bnoordhuis commented on Nov 9, 2015

    @bnoordhuis
    Member

    Maybe just edit your .npmrc in case it contains valuable things like tokens.

  9. brascosDad commented on Nov 9, 2015

    @brascosDad
    Author

    i see a .rvmrc folder in $HOME, but no .npmrc.....and how exactly would I edit it (if I could find it)?

  10. bnoordhuis commented on Nov 9, 2015

    @bnoordhuis
    Member

    If you don't have a .npmrc, don't worry about it. If you do, just vim will do; it's a text file.

  11. brascosDad commented on Nov 9, 2015

    @brascosDad
    Author

    I don't have one...any other ideas? I think I've tried everything on our
    list
    On Mon, Nov 9, 2015 at 1:39 PM Ben Noordhuis notifications@github.com
    wrote:

    If you don't have a .npmrc, don't worry about it. If you do, just vim will
    do; it's a text file.

    —
    Reply to this email directly or view it on GitHub
    #809 (comment).

  12. mmahalwy commented on Nov 9, 2015

    @mmahalwy

    getting same problem here when trying to install ember-cli

  13. neoadventist commented on Nov 10, 2015

    @neoadventist

    same problem here with contextify.

  14. brascosDad commented on Nov 11, 2015

    @brascosDad
    Author

    for me, the solution was fixing the space in my home folder (that was a whole other "can o' worms"). then 'npm install' worked like a charm. also, I suggest reaching out to the folks at npm if it truly is npm related. They're great!

  15. midhunadarvin commented on Nov 29, 2015

    @midhunadarvin

    I also had the node-gyp rebuild error while installing utf-8-validate package through npm. Removing the space from my filepath worked for me.

  16. 225 remaining items

  17. belvederef commented on May 24, 2019

    @belvederef

    Nothing of what suggested above worked for me, however, I solved my issue switching to a different node version (e.g. using nvm).

  18. kukoman commented on May 24, 2019

    @kukoman
  19. mrpandat commented on May 26, 2019

    @mrpandat

    Switching from node v12.3.1 to v8.16.0 with nvm solved this for me.

    Thanks @belvederef 🎉

  20. nbeers22 commented on Jun 9, 2019

    @nbeers22

    used nvm and downgraded to node v11.10.0, which solved my problem

  21. woprandi commented on Jun 12, 2019

    @woprandi

    I always have a problem to rebuild a old ember app despite a yarn.lock because of this package, unacceptable...

  22. strarsis commented on Jun 12, 2019

    @strarsis

    @woprandi: The system itself differs from the one where the bindings compilation worked,
    so it fails, this shouldn't happen, but this package has this kind of issue.
    You could try to install the app dependencies inside a VM/container that runs on an older *nix distribution (from which you know that it worked in the past) and hopefully it compiles.

  23. pthornhi commented on Jun 14, 2019

    @pthornhi

    Only @punitnathani's solution worked for me. Downgrade from node@12.x.x

    to

    npm install -g node@11.10.0

  24. Daisuke-sama commented on Jun 16, 2019

    @Daisuke-sama

    For me as well @pthornhi . I had spent, probably, a few days for experiments...

  25. shaikh-shahid commented on Jun 18, 2019

    @shaikh-shahid

    Follow these steps to resolve the issue.

    1: Make sure you have build-tools installed.
    2: Update node-gyp
    3: Delete package-lock.json and node modules folder and run npm install again.
    4: Deleting ~/.node-gyp folder and run npm install again.

    Source: https://codeforgeek.com/make-failed-with-exit-code-2/

  26. mikkz commented on Jun 20, 2019

    @mikkz

    For those who are using AMI 2, I resolve it using

    sudo yum groupinstall "Development Tools"

    Since my errors were

    make: Entering directory `/home/www/tieza-queue/notification/node_modules/fibers/build'
      CXX(target) Release/obj.target/fibers/src/fibers.o
    make: g++: Command not found
    make: *** [Release/obj.target/fibers/src/fibers.o] Error 127
    make: Leaving directory `/home/www/tieza-queue/notification/node_modules/fibers/build'
    gyp ERR! build error
    gyp ERR! stack Error: `make` failed with exit code: 2
    gyp ERR! stack     at ChildProcess.onExit (/home/ec2-user/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
    gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
    gyp ERR! System Linux 4.14.114-105.126.amzn2.x86_64
    gyp ERR! command "/home/ec2-user/.nvm/versions/node/v10.15.3/bin/node" "/home/ec2-user/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
    gyp ERR! cwd /home/www/tieza-queue/notification/node_modules/fibers
    gyp ERR! node -v v10.15.3
    gyp ERR! node-gyp -v v3.8.0
    gyp ERR! not ok
    node-gyp exited with code: 1
    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`
    Alpine users please run: `sudo apk add python make g++`
    sh: nodejs: command not found
    npm WARN acorn-jsx@5.0.1 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN notification@1.0.0 No description
    npm WARN notification@1.0.0 No repository field.
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
    
    npm ERR! file sh
    npm ERR! code ELIFECYCLE
    npm ERR! errno ENOENT
    npm ERR! syscall spawn
    npm ERR! fibers@2.0.2 install: `node build.js || nodejs build.js`
    npm ERR! spawn ENOENT
    npm ERR!
    npm ERR! Failed at the fibers@2.0.2 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!     /home/ec2-user/.npm/_logs/2019-06-20T07_19_19_837Z-debug.log
    
  27. yankikucuk commented on Jun 20, 2019

    @yankikucuk

    @pthornhi its worked for me.

  28. MagicScorpion commented on Jun 20, 2019

    @MagicScorpion

    I am getting below error while installing btlejuice.

    gyp ERR! build error
    gyp ERR! stack Error: make failed with exit code: 2
    gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:262:23)
    gyp ERR! stack at ChildProcess.emit (events.js:189:13)
    gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
    gyp ERR! System Linux 4.19.0-kali4-amd64
    gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
    gyp ERR! cwd /usr/local/lib/node_modules/btlejuice/node_modules/bluetooth-hci-socket
    gyp ERR! node -v v10.15.2
    gyp ERR! node-gyp -v v3.8.0
    gyp ERR! not ok

  29. orwell1984 commented on Jun 25, 2019

    @orwell1984

    Gotta love hundreds of people checking in on a closed issue to no avail. Good maintainer ethics!

  30. bzoz commented on Jun 25, 2019

    @bzoz
    Contributor

    This page is for that specific issue from 3yrs ago, which was solved. It is not catch-all place for all node-gyp failures. If you have issues with building a node module:

    • open an issue in that module issue tracker,
    • if that does not help and you are suspecting issue with node-gyp itself, open new issue here with your specific system config and error message
  31. locked as resolved and limited conversation to collaborators on Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions