2015-11-29 3 views
2

Во-первых, я попытался установить bcrypt с номером npm.Ошибка установки Bcrypt на Linux

Ошибка:

/ 
> [email protected] install /home/saaggy18/node-projects/10-projects/node_modules/bcrypt 
> node-gyp rebuild 

/usr/local/lib/node_modules/npm/bin/node-gyp-bin/node-gyp: 3: /usr/local/lib/node_modules/npm/bin/node-gyp-bin/node-gyp: node: Permission denied 
npm ERR! Linux 3.19.0-33-generic 
npm ERR! argv "/usr/local/bin/node" "/usr/local/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 126 
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/saaggy18/node-projects/10-projects/npm-debug.log 

Тогда я нашел this вопрос

На 3-й шаг, который, node-gyp configure

Это удара об ошибке:

Error: Cannot find module 'nan' 
    at Function.Module._resolveFilename (module.js:337:15) 
    at Function.Module._load (module.js:287:25) 
    at Module.require (module.js:366:17) 
    at require (module.js:385:17) 
    at [eval]:1:1 
    at Object.exports.runInThisContext (vm.js:54:17) 
    at Object.<anonymous> ([eval]-wrapper:6:22) 
    at Module._compile (module.js:435:26) 
    at node.js:578:27 
    at doNTCallback0 (node.js:419:9) 
gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.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/local/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.19.0-33-generic 
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "configure" 
gyp ERR! cwd /home/saaggy18/node.bcrypt.js 
gyp ERR! node -v v4.2.2 
gyp ERR! node-gyp -v v3.2.0 
gyp ERR! not ok 

Моя ОС: Elementary Os Freya, в основном Ubuntu и У меня установлен python.

+0

Попробуйте 'npm install' в'/home/saaggy18/node.bcrypt.js' - я подозреваю, что он установит зависимости, необходимые для его создания и запуска. – Kenney

+0

Ya. Я сделал это раньше. Но почему это так расстраивает установку bcrypt в отличие от других? – marukobotto

+0

Потому что он написан на C и должен быть скомпилирован для вашей платформы. О, еще одна вещь; есть вероятность отказа в разрешении для/usr/local/lib, которая обычно требует привилегий root ... – Kenney

ответ

3

пытаются установить сборку заменимых с помощью команды:

Sudo APT-получить установку сборки заменимых

и повторите попытку. Я надеюсь, что это поможет вам

+0

Да! Это работает. – vineet

Смежные вопросы