Вот результат установки sudo npm. Я должен был отформатировать свой MAC и потерял все. Я перенес свой проект в репозиторий github и впоследствии клонировал его локально. Поэтому сейчас я пытаюсь установить все зависимости, но получаю следующую ошибку.
3 errors generated. make: *** [Release/obj.target/grpc_node/ext/byte_buffer.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:262:23) gyp ERR! stack at ChildProcess.emit (events.js:203:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) gyp ERR! System Darwin 18.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" "--library=static_library" "--module=/Users/anonymous/Development/Mundo1.5/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/Users/anonymous/Development/Mundo1.5/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72" gyp ERR! cwd /Users/anonymous/Development/Mundo1.5/node_modules/grpc gyp ERR! node -v v12.6.0 gyp ERR! node-gyp -v v3.8.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 --library=static_library --module=/Users/anonymous/Development/Mundo1.5/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/anonymous/Development/Mundo1.5/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1) node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/anonymous/Development/Mundo1.5/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:203:13) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) node-pre-gyp ERR! System Darwin 18.6.0 node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/anonymous/Development/Mundo1.5/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library" node-pre-gyp ERR! cwd /Users/anonymous/Development/Mundo1.5/node_modules/grpc node-pre-gyp ERR! node -v v12.6.0 node-pre-gyp ERR! node-pre-gyp -v v0.12.0 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 --library=static_library --module=/Users/anonymous/Development/Mundo1.5/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/anonymous/Development/Mundo1.5/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! grpc@1.18.0 install: `node-pre-gyp install --fallback-to-build
Убедитесь, что у вас есть права доступа к папке проекта. Вы можете использовать следующую команду для установки npm
sudo npm install --unsafe-perm
И вы можете восстановить узел-гипп с помощью
sudo node-gyp rebuild -g --unsafe-perm