не может выполнить команду установки npm

#node.js #npm

#node.js #npm

Вопрос:

Я новичок в node и хотел бы запустить этот проект: https://github.com/srtucker22/chatty

Когда я клонирую и запускаю команду npm install, я получаю :

                          ~~~~~~~~~~~~~~~~~ ^
/Users/allstar/Library/Caches/node-gyp/14.13.0/include/node/v8.h:2810:3: note: 'ToString' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
  ^
/Users/allstar/Library/Caches/node-gyp/14.13.0/include/node/v8config.h:431:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [Release/obj.target/bcrypt_lib/src/bcrypt_node.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/allstar/dev/github/chatty/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/Users/allstar/dev/github/chatty/node_modules/bcrypt/lib/binding" "--napi_version=7" "--node_abi_napi=napi"
gyp ERR! cwd /Users/allstar/dev/github/chatty/node_modules/bcrypt
gyp ERR! node -v v14.13.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/allstar/dev/github/chatty/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/Users/allstar/dev/github/chatty/node_modules/bcrypt/lib/binding --napi_version=7 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/allstar/dev/github/chatty/node_modules/bcrypt/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1047:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
node-pre-gyp ERR! System Darwin 19.6.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/allstar/dev/github/chatty/node_modules/bcrypt/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/allstar/dev/github/chatty/node_modules/bcrypt
node-pre-gyp ERR! node -v v14.13.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.2
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/allstar/dev/github/chatty/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/Users/allstar/dev/github/chatty/node_modules/bcrypt/lib/binding --napi_version=7 --node_abi_napi=napi' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt@3.0.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@3.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!     /Users/allstar/.npm/_logs/2020-10-06T09_37_52_418Z-debug.log
  

Может ли какая-либо помощь в том, что не так?

мои текущие версии :

npm: 6.14.8

узел: v14.13.0

Спасибо

Ответ №1:

Вы пробовали работать со стабильной версией node? например, 12.18.3

Ответ №2:

Это ошибка, связанная с node-pre-gyp.

Попробуйте выполнить установку npm с флагом —build-from-resource:

 npm install --build-from-resource
  

https://github.com/nodejs/node-gyp/issues/1599

Ответ №3:

Попробуйте выполнить следующие действия:

  1. Удалите node_modules папку, если она есть.
  2. npm cache clean --force
  3. npm install