angular - 格式化我的 MAC 后,无法为我从 Github 克隆的项目运行 NPM INSTALL
问题描述
这是 sudo npm install 的结果。我不得不格式化我的 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 install
sudo npm install --unsafe-perm
你可以重建 node-gyp
sudo node-gyp rebuild -g --unsafe-perm
推荐阅读
- angular - SwaggerUI - 如何在 Angular 9 中为 SwaggerUI 外部创建自定义布局和插件
- c# - 我该怎么做 if(在 if == "x")
- design-patterns - 我如何管理一些设计模式来解决这个问题
- unit-testing - 如何优雅地测试 Go 中包含多个客户端的方法?
- javascript - 在数组表js中插入值
- ios - 我如何在我的 Mac 应用程序上读取应用程序 iPhone 输出?
- linux - 在某些特定情况下没有从 ProcessBuilder 的输入流中得到响应
- sql - JOOQ 乐观锁定和 DataChangedException:数据库记录已在 record.update 上更改
- javascript - TypeError:debts.map 不是仅在 chrome React 上的函数
- java - Spring Boot Security PermitAll with RequestHeaderMatcher not working