Can you please help me with this error?

dhcp-rhodes-571:harberger-token kishorpatil$ sudo npm install scrypt

> scrypt@6.0.3 preinstall /Users/kishorpatil/blockchain/radical-markets/harberger-token/node_modules/scrypt
> node node-scrypt-preinstall.js

Error: Error: Command failed: ./configure
configure: error: in `/Users/kishorpatil/blockchain/radical-markets/harberger-token/node_modules/scrypt/scrypt/scrypt-1.2.0':
configure: error: C compiler cannot create executables
See `config.log' for more details

> scrypt@6.0.3 install /Users/kishorpatil/blockchain/radical-markets/harberger-token/node_modules/scrypt
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/kishorpatil/blockchain/radical-markets/harberger-token/node_modules/scrypt/build'
gyp ERR! System Darwin 17.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/kishorpatil/blockchain/radical-markets/harberger-token/node_modules/scrypt
gyp ERR! node -v v8.11.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN enoent ENOENT: no such file or directory, open '/Users/kishorpatil/blockchain/radical-markets/harberger-token/package.json'
npm WARN harberger-token No description
npm WARN harberger-token No repository field.
npm WARN harberger-token No README data
npm WARN harberger-token No license field.

npm ERR! errno 1
npm ERR! scrypt@6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the scrypt@6.0.3 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!     /Users/kishorpatil/.npm/_logs/2018-07-15T14_50_36_660Z-debug.log
  • Are you on windows, linux or macos? – Ismael Jul 17 '18 at 17:31
  • Mac OS High Sierra – Kishor Patil Jul 18 '18 at 18:28
  • Do you have the C compiler installed? Probably you are better asking in stackoverflow.com seems like a configuration problem. – Ismael Jul 18 '18 at 19:08
  • I confirmed I have GCC installed on my machine by running dhcp-rhodes-571:harberger-token kishorpatil$ gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 9.1.0 (clang-902.0.39.2) Target: x86_64-apple-darwin17.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin – Kishor Patil Jul 18 '18 at 20:33

I had the same issue till yesterday, please refer to this link https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules I followed instructions to manually setup the environment. install vs 2017 community version with "c++ for desktop development" workload as mentioned and do the next steps. this much should be enough to get you running. Thanks, good luck 👍

| improve this answer | |
  • I'm on MAC High Sierra .. sorry I didn't add to original questions. I believe your answer / instructions are for windows – Kishor Patil Jul 18 '18 at 18:47
  • yes, it is for windows, I don't know the right tools for mac OS – Indrajeet Nikam Jul 24 '18 at 5:51

Phew .. finally figured out this is NPM permissions issue on Mac. I changed ownership of following directories from root to my user name :

  • sudo chown -R /usr/local/share/
  • sudo chown -R /usr/local/bin/
  • sudo chown -R /usr/local/lib/node_modules/
| improve this answer | |
  • It is a bad idea to change ownership for files in global directories to your user. I'd suggest to try using a node manager like nvm that will install node inside your home directory. – Ismael Oct 31 '18 at 5:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.