Node.bcrypt.js: Can't build via npm: gyp failed with exit code 1

Created on 4 May 2015  Â·  26Comments  Â·  Source: kelektiv/node.bcrypt.js

I am using

  • Windows 8.1
  • node v0.12.2
  • npm 2.7.4

I was installing bcrypt via cmd (admin) and I got following errors.

gyp: binding.gyp not found (cwd: C:\Windows\system32\node_modules\bcrypt) while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:343:16)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Windows\system32\node_modules\bcrypt
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok 
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "bcrypt"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! 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-gyp rebuild
npm ERR! 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!     C:\Windows\system32\npm-debug.log

I also uses

  • Visual Studio 2013

Most helpful comment

rm -rf ~/.node-gyp/
rm -r node_modules/.bin/;
rm -r build/
npm install bcrypt

All 26 comments

and node-gyp version 1.0.3

Having the same problem on Ubuntu since updating to Node 0.12.2

> [email protected] install [...]/node_modules/bcrypt
> 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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.16.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 [...]/node_modules/bcrypt
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok 
npm ERR! Linux 3.16.0-36-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "bcrypt"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! 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-gyp rebuild
npm ERR! 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!     [...]/npm-debug.log

@ncb000gt Sorry I forgot to check the answer of this issue.
Thanks for your suggestion, but it still fails on my computer with following error.

gyp ERR! configure error 
gyp ERR! stack Error: spawn C:\Python27\ ENOENT
gyp ERR! stack     at exports._errnoException (util.js:746:11)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
gyp ERR! stack     at child_process.js:1144:20
gyp ERR! stack     at process._tickCallback (node.js:355:11)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "node" "C:\\ProgramFiles\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Jongbin\node_modules\bcrypt
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok 
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--msvs_version=2013" "bcrypt"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! 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-gyp rebuild
npm ERR! 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!     C:\Users\Jongbin\npm-debug.log

FWIW, I managed to get it to work in Ubuntu. Based on this line:

gyp_main.py: error: no such option: --no-parallel

I went into the node-gyp config.js file and commented out line 316 //argv.push('--no-parallel').

After doing that, it had no problem.

I am using:

  • Freebsd 10.1 (AWS / EC2)
  • iojs 2.0.1
  • npm 2.10.1

As root/su, I have also npm install -g npm and npm install -g node-gyp. This error is due this installer trying to use the underlying user account, not the current user, i.e. whoami

npm install -g bcrypt              -
> [email protected] install /usr/local/lib/node_modules/bcrypt
> node-gyp rebuild

gyp WARN EACCES user "ec2-user" does not have permission to access the dev dir "/root/.node-gyp/2.0.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/bcrypt/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: 404 status code downloading tarball
gyp ERR! stack     at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:246:14)
gyp ERR! stack     at emitOne (events.js:82:20)
gyp ERR! stack     at Request.emit (events.js:166:7)
gyp ERR! stack     at Request.onRequestResponse (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1156:10)
gyp ERR! stack     at emitOne (events.js:77:13)
gyp ERR! stack     at ClientRequest.emit (events.js:166:7)
gyp ERR! stack     at HTTPParser.parserOnIncomingClient (_http_client.js:414:21)
gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
gyp ERR! stack     at Socket.socketOnData (_http_client.js:304:20)
gyp ERR! stack     at emitOne (events.js:77:13)
gyp ERR! System FreeBSD 10.1-RELEASE-p10
gyp ERR! command "/usr/local/bin/iojs" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/bcrypt
gyp ERR! node -v v2.0.1
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok 
npm ERR! FreeBSD 10.1-RELEASE-p10
npm ERR! argv "/usr/local/bin/iojs" "/usr/local/bin/npm" "install" "-g" "bcrypt"
npm ERR! node v2.0.1
npm ERR! npm  v2.10.1
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! 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-gyp rebuild
npm ERR! 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!     /usr/home/ec2-user/test/npm-debug.log

This is not an issue with this module. Looks like some other install issue with your environment.

@chongkong Were you ever able to figure out the issue? I'm running into the same error.

This was probably the most painful issue I've ever had to deal with...

Install Visual Studio Community 2013 (not 2015)....

I should also note that you will need to run:
npm config set msvs_version 2013 --global

I tried running 'sudo node-gyp rebuild'.

I got the error in gyp.

gyp: binding.gyp not found (cwd: /usr/lib/node_modules/npm/node_modules/node-gyp) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/node-gyp/lib/configure.js:305:16)
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 Linux 3.2.0-23-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/npm/node_modules/node-gyp
gyp ERR! node -v v4.2.2
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok

I am using

  • Linux mint 13 maya
  • node: 4.2.2
  • npm: 2.14.7
  • gcc: 4.8.1

I tried installing 'sudo npm install bcrypt'

I got error like this:

[email protected] install /home/local/PAYODA/velvizhi.p/Desktop/node/sailstest/node_modules/bcrypt
node-gyp rebuild

make: Entering directory /home/local/PAYODA/velvizhi.p/Desktop/node/sailstest/node_modules/bcrypt/build' CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o In file included from /home/local/PAYODA/velvizhi.p/.node-gyp/4.2.2/include/node/node.h:42:0, from ../node_modules/nan/nan.h:24, from ../src/bcrypt_node.cc:1: /home/local/PAYODA/velvizhi.p/.node-gyp/4.2.2/include/node/v8.h:336:1: error: expected unqualified-id before ‘using’ /home/local/PAYODA/velvizhi.p/.node-gyp/4.2.2/include/node/v8.h:469:1: error: expected unqualified-id before ‘using’ /home/local/PAYODA/velvizhi.p/.node-gyp/4.2.2/include/node/v8.h:852:1: error: expected unqualified-id before ‘using’ In file included from ../node_modules/nan/nan.h:184:0, from ../src/bcrypt_node.cc:1: ../node_modules/nan/nan_maybe_43_inl.h:13:1: error: expected unqualified-id before ‘using’ ../node_modules/nan/nan_maybe_43_inl.h:16:1: error: expected unqualified-id before ‘using’ ../node_modules/nan/nan_maybe_43_inl.h:19:12: error: ‘Maybe’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:24:12: error: ‘Maybe’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:31:1: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:36:1: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:41:1: error: ‘Maybe’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:46:1: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:51:1: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:60:1: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:65:12: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:70:12: error: ‘Maybe’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:77:12: error: ‘Maybe’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:84:12: error: ‘Maybe’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:92:12: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:99:1: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:109:12: error: ‘Maybe’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:115:12: error: ‘Maybe’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:119:12: error: ‘Maybe’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:126:1: error: ‘Maybe’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:131:1: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:136:1: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:140:12: error: ‘Maybe’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:146:12: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:151:12: error: ‘Maybe’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:157:12: error: ‘Maybe’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:163:12: error: ‘Maybe’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:169:12: error: ‘Maybe’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:175:12: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:181:12: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:187:12: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:195:12: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:202:1: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:206:12: error: ‘Maybe’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:210:12: error: ‘Maybe’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:214:12: error: ‘Maybe’ does not name a type ../node_modules/nan/nan_maybe_43_inl.h:218:12: error: ‘MaybeLocal’ does not name a type In file included from ../node_modules/nan/nan.h:189:0, from ../src/bcrypt_node.cc:1: ../node_modules/nan/nan_converters.h:14:11: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan_converters.h:16:56: error: ‘Maybe’ does not name a type ../node_modules/nan/nan_converters.h:26:1: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:27:1: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:28:1: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:29:1: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:30:1: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:31:1: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:32:1: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:42:1: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:43:1: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:44:1: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:45:1: error: ‘return_t’ does not name a type ../node_modules/nan/nan_converters.h:46:1: error: ‘return_t’ does not name a type In file included from ../node_modules/nan/nan_converters.h:59:0, from ../node_modules/nan/nan.h:189, from ../src/bcrypt_node.cc:1: ../node_modules/nan/nan_converters_43_inl.h:18:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::Boolean>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:19:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::Number>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:20:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::String>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:21:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::Object>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:22:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::Integer>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:23:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::Uint32>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:24:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::Int32>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:34:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<bool>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:35:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<double>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:36:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<long int>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:37:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<unsigned int>’ does not name a type ../node_modules/nan/nan_converters_43_inl.h:38:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<int>’ does not name a type In file included from ../node_modules/nan/nan.h:190:0, from ../src/bcrypt_node.cc:1: ../node_modules/nan/nan_new.h: In function ‘v8::Local<T> Nan::imp::To(v8::Local<v8::Integer>) [with T = v8::Integer]’: ../node_modules/nan/nan_new.h:21:32: error: no matching function for call to ‘To(v8::Local<v8::Integer>&)’ ../node_modules/nan/nan_new.h:21:32: note: candidate is: ../node_modules/nan/nan_converters.h:53:38: note: template<class T> typename Nan::imp::ToFactory::return_t Nan::To(v8::Local<v8::Value>) ../node_modules/nan/nan_new.h: In function ‘v8::Local<T> Nan::imp::To(v8::Local<v8::Integer>) [with T = v8::Int32]’: ../node_modules/nan/nan_new.h:28:30: error: no matching function for call to ‘To(v8::Local<v8::Integer>&)’ ../node_modules/nan/nan_new.h:28:30: note: candidate is: ../node_modules/nan/nan_converters.h:53:38: note: template<class T> typename Nan::imp::ToFactory::return_t Nan::To(v8::Local<v8::Value>) ../node_modules/nan/nan_new.h: In function ‘v8::Local<T> Nan::imp::To(v8::Local<v8::Integer>) [with T = v8::Uint32]’: ../node_modules/nan/nan_new.h:35:31: error: no matching function for call to ‘To(v8::Local<v8::Integer>&)’ ../node_modules/nan/nan_new.h:35:31: note: candidate is: ../node_modules/nan/nan_converters.h:53:38: note: template<class T> typename Nan::imp::ToFactory::return_t Nan::To(v8::Local<v8::Value>) ../node_modules/nan/nan_new.h: At global scope: ../node_modules/nan/nan_new.h:43:11: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan_new.h:75:17: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:141:17: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:147:17: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:148:17: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:160:17: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:161:17: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:162:17: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:163:17: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:165:17: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:166:17: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:182:17: error: ‘return_t’ does not name a type ../node_modules/nan/nan_new.h:183:17: error: ‘return_t’ does not name a type In file included from ../node_modules/nan/nan_new.h:189:0, from ../node_modules/nan/nan.h:190, from ../src/bcrypt_node.cc:1: ../node_modules/nan/nan_implementation_12_inl.h:56:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::Date>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:209:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::RegExp>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:228:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::Script>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:234:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::Script>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:266:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:274:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:280:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:287:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:293:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:298:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:359:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::UnboundScript>’ does not name a type ../node_modules/nan/nan_implementation_12_inl.h:366:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::UnboundScript>’ does not name a type In file included from ../node_modules/nan/nan.h:190:0, from ../src/bcrypt_node.cc:1: ../node_modules/nan/nan_new.h:291:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_new.h:297:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_new.h:303:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_new.h:309:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_new.h:315:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_new.h:321:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::String>’ does not name a type ../node_modules/nan/nan_new.h:327:1: error: ‘return_t’ in ‘struct Nan::imp::Factory<v8::RegExp>’ does not name a type In file included from ../src/bcrypt_node.cc:1:0: ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::Error(const char*)’: ../node_modules/nan/nan.h:641:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In function ‘void Nan::ThrowError(const char*)’: ../node_modules/nan/nan.h:641:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::RangeError(const char*)’: ../node_modules/nan/nan.h:642:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In function ‘void Nan::ThrowRangeError(const char*)’: ../node_modules/nan/nan.h:642:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::ReferenceError(const char*)’: ../node_modules/nan/nan.h:643:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In function ‘void Nan::ThrowReferenceError(const char*)’: ../node_modules/nan/nan.h:643:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::SyntaxError(const char*)’: ../node_modules/nan/nan.h:644:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In function ‘void Nan::ThrowSyntaxError(const char*)’: ../node_modules/nan/nan.h:644:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::TypeError(const char*)’: ../node_modules/nan/nan.h:645:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In function ‘void Nan::ThrowTypeError(const char*)’: ../node_modules/nan/nan.h:645:3: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: At global scope: ../node_modules/nan/nan.h:653:14: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan.h:675:14: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan.h:691:14: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan.h:704:14: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan.h:721:14: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan.h:727:14: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan.h:735:14: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan.h:742:14: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan.h:748:14: error: ‘MaybeLocal’ does not name a type ../node_modules/nan/nan.h: In member function ‘void Nan::Callback::SetFunction(const v8::Local<v8::Function>&)’: ../node_modules/nan/nan.h:1368:40: error: ‘Set’ was not declared in this scope ../node_modules/nan/nan.h:1368:40: note: suggested alternative: /home/local/PAYODA/velvizhi.p/.node-gyp/4.2.2/include/node/v8.h:3021:17: note: ‘v8::Set’ ../node_modules/nan/nan.h: In member function ‘void Nan::AsyncWorker::SaveToPersistent(const char*, const v8::Local<v8::Value>&)’: ../node_modules/nan/nan.h:1490:41: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In member function ‘v8::Local<v8::Value> Nan::AsyncWorker::GetFromPersistent(const char*) const’: ../node_modules/nan/nan.h:1508:45: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In member function ‘virtual void Nan::AsyncWorker::HandleErrorCallback()’: ../node_modules/nan/nan.h:1542:58: error: no matching function for call to ‘New(const char*)’ ../node_modules/nan/nan.h:1542:58: note: candidates are: ../node_modules/nan/nan_implementation_12_inl.h:402:21: note: template<class T, class M> v8::Local<T> Nan::New(const v8::Persistent<S, M>&) ../node_modules/nan/nan_implementation_12_inl.h:407:21: note: template<class T, class M> v8::Local<T> Nan::New(const Nan::Persistent<T, M>&) ../node_modules/nan/nan_new.h:201:1: note: template<class T> typename Nan::imp::Factory::return_t Nan::New() ../node_modules/nan/nan_new.h:207:1: note: template<class T, class A0> typename Nan::imp::Factory<T>::return_t Nan::New(A0) ../node_modules/nan/nan_new.h:213:1: note: template<class T, class A0, class A1> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1) ../node_modules/nan/nan_new.h:219:1: note: template<class T, class A0, class A1, class A2> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1, A2) ../node_modules/nan/nan_new.h:225:1: note: template<class T, class A0, class A1, class A2, class A3> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1, A2, A3) ../node_modules/nan/nan_new.h:237:1: note: template<class T> typename Nan::imp::Factory::return_t Nan::New(Nan::FunctionCallback, v8::Local<v8::Value>) ../node_modules/nan/nan_new.h:245:1: note: template<class T, class A2> typename Nan::imp::Factory<T>::return_t Nan::New(Nan::FunctionCallback, v8::Local<v8::Value>, A2) ../node_modules/nan/nan.h: In function ‘void Nan::SetMethod(const T&, const char*, Nan::FunctionCallback)’: ../node_modules/nan/nan.h:1832:45: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In function ‘void Nan::SetPrototypeMethod(v8::Local<v8::FunctionTemplate>, const char*, Nan::FunctionCallback)’: ../node_modules/nan/nan.h:1845:45: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’ In file included from ../src/bcrypt_node.cc:1:0: ../node_modules/nan/nan.h: In function ‘void Nan::Export(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE, const char*, Nan::FunctionCallback)’: ../node_modules/nan/nan.h:2116:35: error: no matching function for call to ‘New(const char*&)’ ../node_modules/nan/nan.h:2116:35: note: candidates are: ../node_modules/nan/nan_implementation_12_inl.h:402:21: note: template<class T, class M> v8::Local<T> Nan::New(const v8::Persistent<S, M>&) ../node_modules/nan/nan_implementation_12_inl.h:407:21: note: template<class T, class M> v8::Local<T> Nan::New(const Nan::Persistent<T, M>&) ../node_modules/nan/nan_new.h:201:1: note: template<class T> typename Nan::imp::Factory::return_t Nan::New() ../node_modules/nan/nan_new.h:207:1: note: template<class T, class A0> typename Nan::imp::Factory<T>::return_t Nan::New(A0) ../node_modules/nan/nan_new.h:213:1: note: template<class T, class A0, class A1> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1) ../node_modules/nan/nan_new.h:219:1: note: template<class T, class A0, class A1, class A2> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1, A2) ../node_modules/nan/nan_new.h:225:1: note: template<class T, class A0, class A1, class A2, class A3> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1, A2, A3) ../node_modules/nan/nan_new.h:237:1: note: template<class T> typename Nan::imp::Factory::return_t Nan::New(Nan::FunctionCallback, v8::Local<v8::Value>) ../node_modules/nan/nan_new.h:245:1: note: template<class T, class A2> typename Nan::imp::Factory<T>::return_t Nan::New(Nan::FunctionCallback, v8::Local<v8::Value>, A2) ../node_modules/nan/nan.h:2117:50: error: ‘Set’ was not declared in this scope ../node_modules/nan/nan.h:2117:50: note: suggested alternative: /home/local/PAYODA/velvizhi.p/.node-gyp/4.2.2/include/node/v8.h:3021:17: note: ‘v8::Set’ ../node_modules/nan/nan.h: In constructor ‘Nan::Tap::Tap(v8::Local<v8::Value>)’: ../node_modules/nan/nan.h:2124:30: error: no matching function for call to ‘To(v8::Local<v8::Value>&)’ ../node_modules/nan/nan.h:2124:30: note: candidate is: ../node_modules/nan/nan_converters.h:53:38: note: template<class T> typename Nan::imp::ToFactory::return_t Nan::To(v8::Local<v8::Value>) ../node_modules/nan/nan.h: In member function ‘void Nan::Tap::ok(bool, const char*)’: ../node_modules/nan/nan.h:2137:33: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In member function ‘void Nan::Tap::pass(const char*)’: ../node_modules/nan/nan.h:2143:30: error: ‘Nan::imp::FactoryBase<v8::Boolean>::return_t’ has no member named ‘ToLocalChecked’ ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::Error(const char*)’: ../node_modules/nan/nan.h:641:3: warning: control reaches end of non-void function [-Wreturn-type] ../node_modules/nan/nan_new.h: In function ‘v8::Local<T> Nan::imp::To(v8::Local<v8::Integer>) [with T = v8::Uint32]’: ../node_modules/nan/nan_new.h:36:1: warning: control reaches end of non-void function [-Wreturn-type] make: *** [Release/obj.target/bcrypt_lib/src/bcrypt_node.o] Error 1 make: Leaving directory/home/local/PAYODA/velvizhi.p/Desktop/node/sailstest/node_modules/bcrypt/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/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 Linux 3.2.0-23-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/local/PAYODA/velvizhi.p/Desktop/node/sailstest/node_modules/bcrypt
gyp ERR! node -v v4.2.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Linux 3.2.0-23-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "bcrypt"
npm ERR! node v4.2.2
npm ERR! npm v2.14.7
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! 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-gyp rebuild
npm ERR! 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! /home/local/PAYODA/velvizhi.p/Desktop/node/sailstest/npm-debug.log

@velvizhip Did you resolved the error. If yes please post the solution.

gyp: binding.gyp not found (cwd: /usr/lib/node_modules/npm/node_modules/node-gyp) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/node-gyp/lib/configure.js:305:16)
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 Linux 3.2.0-23-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/npm/node_modules/node-gyp
gyp ERR! node -v v4.2.2
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok

I too facing the same issue and struggling for a day.

@Mani-rpx I could not find the solution. I ended up using bcryptjs. Both are same.

I partially solved this error by the help of this link
https://github.com/nodejs/node-gyp#the-bindinggyp-file
by manually adding binding.gyp file in root directory and running node-gyp rebuild.this created a build file but gives error

   Warning: Missing input files:
    D:\API\build\..\src\binding.cc

rm -rf ~/.node-gyp/
rm -r node_modules/.bin/;
rm -r build/
npm install bcrypt

Oh,My god...!

I am facing same Issue. I have tried everything available on this as well as #1209 still no luck any one found any solution

@chongkong @BarthesSimpson @hernanifernandes-luizalabs @Mani-rpx @pakTech786

solutions here feels like treating the a problem specific to node version - I'm thinking best approach here is to use nvm / node version manager - this can help lock node modules to older versions over time - this has saved me with ruby / rvm and other version managers / gem bundler + cocoapods.

https://stackoverflow.com/questions/16904658/node-version-manager-install-nvm-command-not-found

notes here
https://gist.github.com/johndpope/c52189a9f57e34c67cd3f847dea1c7a0

it's node version problem.
I am facing same Issue and i solved by upgrade node version..

NB - upgrading node is not a silver bullet. As you’ll likely run into issues where older repos require older dependencies forcing you to roll back / downgrade. With node version manager / nvm you can easily switch.
Nvm use ‘1.0.0’

i am facing same error.
KeyError: '2017'
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplib\configure.js:308:16)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:194:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd E:\Work\John\Ionic2CLI-Meteor-WhatsApp-masternode_modules\sharp
gyp ERR! node -v v7.10.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidarnode_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.2 (node_modules\watchpacknode_modules\chokidarnode_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN @agm/[email protected] requires a peer of @angular/common@^5.0.0 || ^6.0.0 but none was installed.
npm WARN @agm/[email protected] requires a peer of @angular/core@^5.0.0 || ^6.0.0 but none was installed.
npm WARN [email protected] requires a peer of ajv@^6.0.0 but none was installed.
npm WARN [email protected] requires a peer of rxjs@^6.0.0 but none was installed.
npm ERR! Windows_NT 10.0.17134
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "--save" "sharp"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

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

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\YCN1\AppDataRoamingnpm-cache_logs\2018-07-08T12_36_48_961Z-debug.log

Pls help me

for pc - you maybe able to use this @ying-yue https://github.com/coreybutler/nvm-windows
otherwise just upgrade node
you seem to be using node -v v7.10.0
upgrade it - and problem will be solved.

@chongkong Did you fix it? I am facing with the same issue. It works well on my native windows machine. But when I install windows on my Mac using bootcamp, project builds fail 😢

I had a similar issue when running npm update. The output had this in it as well.

Downloading binary from https://github.com/sass/node-sass/releases/download/v3.13.1/darwin-x64-67_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/darwin-x64-67_binding.node": 

HTTP error 404 Not Found

I ran the command npm install node-sass now npm update and npm install work fine and I no longer get gyp ERR!

Was this page helpful?
0 / 5 - 0 ratings