kelektiv / node.bcrypt.js

bcrypt for NodeJs
MIT License
7.4k stars 512 forks source link

Installation from source fails if there is a space in the path to working directory #961

Open recrsn opened 1 year ago

recrsn commented 1 year ago

Underlying issue with gyp:

gyp is the build tool used by node-gyp, which is in-turn used by node-pre-gyp to compile native addons from source

If you get an error like the following while installing bcrypt then move your code to a directory without spaces anywhere in its complete path. Additionally, your $HOME should also not have any spaces in them (this is true if your username has a space in it)

npm ERR! code 1
npm ERR! path C:\Users\xxx yyy\code\The Complete 2021 Web Development Bootcamp\Course Material\32. Authentication & Security\Secrets\node_modules\bcrypt
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build
npm ERR! 'Security\Secrets\node_modules.bin' is not recognized as an internal or external command,
npm ERR! operable program or batch file.
npm ERR! node:internal/modules/cjs/loader:936
npm ERR! throw err;
npm ERR! ^
npm ERR!
npm ERR! Error: Cannot find module 'C:\Users\xxx yyy\code\The Complete 2021 Web Development Bootcamp\Course Material\node-pre-gyp\bin\node-pre-gyp'
npm ERR! at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
npm ERR! at Function.Module._load (node:internal/modules/cjs/loader:778:27)
npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
npm ERR! at node:internal/main/run_main_module:17:47 {
npm ERR! code: 'MODULE_NOT_FOUND',
npm ERR! requireStack: []
npm ERR! }

npm ERR! A complete log of this run can be found in: