kahmali / meteor-restivus

REST APIs for the Best of Us! - A Meteor 0.9+ package for building REST APIs https://atmospherejs.com/nimble/restivus
MIT License
544 stars 116 forks source link

Failed at the bcrypt@0.7.8 install script 'node-gyp rebuild'. #253

Open deividas717 opened 7 years ago

deividas717 commented 7 years ago

When I run this command I get this error (see image below)

image

How to fix it?

kjetilge commented 7 years ago

I'm having the same problem. Any one who knows what to do ?

kjetilge commented 7 years ago

I created a new user on my mac, installed meteor, created a fresh project and then tried installing restivus. Still same problem...

I've also tried to install bcrypt - and that also fails:

Kjetils-iMac:colorApi kjetilge$ npm install bcrypt

> bcrypt@1.0.1 install /Users/kjetilge/Documents/Dev/QTDev/colorApi/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download: https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.1/bcrypt_lib-v1.0.1-node-v48-darwin-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for bcrypt@1.0.1 and node@6.6.0 (node-v48 ABI) (falling back to source compile with node-gyp) 
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
xcrun: error: active developer path ("/Volumes/SSD-1TB/Applications/Xcode.app/Contents/Developer") does not exist, use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools (or see `man xcode-select`)

xcrun: error: active developer path ("/Volumes/SSD-1TB/Applications/Xcode.app/Contents/Developer") does not exist, use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools (or see `man xcode-select`)

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
xcrun: error: active developer path ("/Volumes/SSD-1TB/Applications/Xcode.app/Contents/Developer") does not exist, use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools (or see `man xcode-select`)
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (/Users/kjetilge/.nvm/versions/node/v6.6.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 16.1.0
gyp ERR! command "/Users/kjetilge/.nvm/versions/node/v6.6.0/bin/node" "/Users/kjetilge/.nvm/versions/node/v6.6.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/kjetilge/Documents/Dev/QTDev/colorApi/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/Users/kjetilge/Documents/Dev/QTDev/colorApi/node_modules/bcrypt/lib/binding"
gyp ERR! cwd /Users/kjetilge/Documents/Dev/QTDev/colorApi/node_modules/bcrypt
gyp ERR! node -v v6.6.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Users/kjetilge/.nvm/versions/node/v6.6.0/bin/node /Users/kjetilge/.nvm/versions/node/v6.6.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/kjetilge/Documents/Dev/QTDev/colorApi/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/Users/kjetilge/Documents/Dev/QTDev/colorApi/node_modules/bcrypt/lib/binding' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/kjetilge/Documents/Dev/QTDev/colorApi/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:877:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Darwin 16.1.0
node-pre-gyp ERR! command "/Users/kjetilge/.nvm/versions/node/v6.6.0/bin/node" "/Users/kjetilge/Documents/Dev/QTDev/colorApi/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/kjetilge/Documents/Dev/QTDev/colorApi/node_modules/bcrypt
node-pre-gyp ERR! node -v v6.6.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.30
node-pre-gyp ERR! not ok 
Failed to execute '/Users/kjetilge/.nvm/versions/node/v6.6.0/bin/node /Users/kjetilge/.nvm/versions/node/v6.6.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/kjetilge/Documents/Dev/QTDev/colorApi/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/Users/kjetilge/Documents/Dev/QTDev/colorApi/node_modules/bcrypt/lib/binding' (1)
npm ERR! Darwin 16.1.0
npm ERR! argv "/Users/kjetilge/.nvm/versions/node/v6.6.0/bin/node" "/Users/kjetilge/.nvm/versions/node/v6.6.0/bin/npm" "install" "bcrypt"
npm ERR! node v6.6.0
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE

npm ERR! bcrypt@1.0.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the bcrypt@1.0.1 install script 'node-pre-gyp install --fallback-to-build'.
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 bcrypt 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 information on how to open an issue for this project with:
npm ERR!     npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls bcrypt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/kjetilge/Documents/Dev/QTDev/colorApi/npm-debug.log
kjetilge commented 7 years ago

Possible fix (worked for me): use: meteor npm and not just npm

Start with a clean project:

meteor create myAPI
cd myAPI
meteor npm install
meteor npm install --save bcrypt
meteor add nimble:restivus

If something goes wrong along after the above do:

rm -rf node_modules
meteor npm install
stefanve commented 7 years ago

Above did not help me so I made a local copy to find which dependency that tried to install bcrypt@0.7.8 (old version) and discovered it was this line in package.js that caused it:

api.use('accounts-password@1.1.4');

When I removed the version constraint from it, restivus was added without problems. If the newer accounts-password will cause problems later remains to be seen.