npm 错误!吉普 错误!堆栈错误:“make”失败,退出代码:2

Ram*_*min 6 node.js reactjs

在 React 项目上运行 npm install 时出现以下错误。

npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/binding/src/binding.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/Users/ramin/dev/frontend-v2/node_modules/node-gyp/lib/build.js:262:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 20.4.0
npm ERR! gyp ERR! command "/usr/local/Cellar/node/16.2.0/bin/node" "/Users/ramin/dev/frontend-v2/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /Users/ramin/dev/frontend-v2/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.2.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
Run Code Online (Sandbox Code Playgroud)

我对节点相对较新,并且在谷歌上搜索我找不到太多错误。对于导致此错误的原因有什么想法吗?

小智 1

我有类似的问题。删除 package-lock.json 然后重新运行“npm install”对我有用。