在mac电脑上执行 npm install时,报错:Cannot download "https://github.com/sass/node-sass/releases/download/v4.14.1/darwin-arm64-83_binding.node"
Cannot download "https://github.com/sass/node-sass/releases/download/v4.14.1/darwin-arm64-83_binding.node":
HTTP error 404 Not Found
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
> node-sass@4.14.1 postinstall /Users/lightsun/workspace/admin-vue/node_modules/element-theme/node_modules/node-sass
> node scripts/build.js
可以使用以下方法解决:
# 先卸载旧的node
#终端切换至x86_64架构
arch -x86_64 zsh
# 再使用nvm安装node@14
nvm install 14
nvm use 14
# 终端切换至arm64架构
arch -arm64 zsh
之后,有可以出现以下问题,可以
ERROR Failed to compile with 1 error 5:28:10 PM
error in ./src/App.vue?vue&type=style&index=0&id=59827d86&prod&lang=scss
Syntax Error: ModuleError: Module Error (from ./node_modules/sass-loader/dist/cjs.js):
Missing binding /Users/lightsun/workspace/admin-vue/node_modules/node-sass/vendor/darwin-x64-83/binding.node
Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 14.x
Found bindings for the following environments:
- OS X Unsupported architecture (arm64) with Node.js 14.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.
@ ./src/App.vue?vue&type=style&index=0&id=59827d86&prod&lang=scss 1:0-496 1:0-496
@ ./src/App.vue
@ ./src/main.js
@ multi ./src/main.js
ERROR Build failed with errors.
可能使用以下命令修复,注,必要时,可以再次修改到x84下再执行
npm rebuild node-sass
npm update