求助,Mac系统vue项目install报错
报文如下
1 error generated.make: *** [Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/swainho/Downloads/factory/node_modules/_node-gyp@3.8.0@node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (node:events:390:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Darwin 20.5.0
gyp ERR! command "/usr/local/Cellar/node/17.0.1/bin/node" "/Users/swainho/Downloads/factory/node_modules/_node-gyp@3.8.0@node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/swainho/Downloads/factory/node_modules/_node-sass@4.14.1@node-sass
gyp ERR! node -v v17.0.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
[npminstall:runscript:error] node-sass@^4.9.0 scripts.postinstall run "node scripts/build.js" error: Error [RunScriptError]: Run "sh -c node scripts/build.js" error, exit code 1
at ChildProcess.<anonymous> (/usr/local/lib/node_modules/cnpm/node_modules/runscript/index.js:96:21)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1062:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) {
stdio: [Object],
exitcode: 1
}
✖ Install fail! RunScriptError: post install error, please remove node_modules before retry!
Run "sh -c node scripts/build.js" error, exit code 1
RunScriptError: Run "sh -c node scripts/build.js" error, exit code 1
at ChildProcess.<anonymous> (/usr/local/lib/node_modules/cnpm/node_modules/runscript/index.js:96:21)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1062:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npminstall version: 5.2.1
npminstall args: /usr/local/Cellar/node/17.0.1/bin/node /usr/local/lib/node_modules/cnpm/node_modules/npminstall/bin/install.js --fix-bug-versions --china --userconfig=/Users/swainho/.cnpmrc --disturl=https://npmmirror.com/mirrors/node --registry=https://registry.npmmirror.com
求各位大佬解决
回答:
先把node_modules
删除重新npm i
还不行就试试cnpm
或者yarn
回答:
sudo npm install
以上是 求助,Mac系统vue项目install报错 的全部内容, 来源链接: utcz.com/p/936405.html