Ошибка при установке bcrypt@5.0.0 скрипта - PullRequest
0 голосов
/ 14 июля 2020

Я получаю эту ошибку, когда запускаю «npm install» на сервере Ubuntu в моем текущем проекте. Я попытался установить bcrypt js, но все равно получаю ту же ошибку.

node-pre-gyp ERR! install error
node-pre-gyp ERR! stack Error: The N-API version of this Node instance is 1. This module supports N-API version(s) 3. This Node instance cannot run this module.
node-pre-gyp ERR! stack     at Object.module.exports.validate_package_json (/home/mission_education/ftp/files/node_modules/node-pre-gyp/lib/util/napi.js:82:9)
node-pre-gyp ERR! stack     at validate_config (/home/mission_education/ftp/files/node_modules/node-pre-gyp/lib/util/versioning.js:229:10)
node-pre-gyp ERR! stack     at Object.module.exports.evaluate (/home/mission_education/ftp/files/node_modules/node-pre-gyp/lib/util/versioning.js:279:5)
node-pre-gyp ERR! stack     at install (/home/mission_education/ftp/files/node_modules/node-pre-gyp/lib/install.js:241:31)
node-pre-gyp ERR! stack     at Object.self.commands.(anonymous function) [as install] (/home/mission_education/ftp/files/node_modules/node-pre-gyp/lib/node-pre-gyp.js:52:37)
node-pre-gyp ERR! stack     at run (/home/mission_education/ftp/files/node_modules/node-pre-gyp/bin/node-pre-gyp:82:30)
node-pre-gyp ERR! stack     at Object.<anonymous> (/home/mission_education/ftp/files/node_modules/node-pre-gyp/bin/node-pre-gyp:134:1)
node-pre-gyp ERR! stack     at Module._compile (module.js:652:30)
node-pre-gyp ERR! stack     at Object.Module._extensions..js (module.js:663:10)
node-pre-gyp ERR! stack     at Module.load (module.js:565:32)
node-pre-gyp ERR! System Linux 4.15.0-101-generic
node-pre-gyp ERR! command "/usr/bin/node" "/home/mission_education/ftp/files/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/mission_education/ftp/files/node_modules/bcrypt
node-pre-gyp ERR! node -v v8.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.15.0
node-pre-gyp ERR! not ok
The N-API version of this Node instance is 1. This module supports N-API version(s) 3. This Node instance cannot run this module.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt@5.0.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@5.0.0 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!     /root/.npm/_logs/2020-07-14T12_11_05_809Z-debug.log```

1 Ответ

0 голосов
/ 14 июля 2020

Вам необходимо обновить Node.JS, потому что у вас есть N-API версии 1, и вам нужна версия 3 как минимум, как указано здесь:

stack Error: The N-API version of this Node instance is 1. This module supports N-API version(s) 3. This Node instance cannot run this module.

...