我是在nodejs官网下的nodejs for macOS 16.17.0 LTS版本,然后命令行配置taobao镜像。
在vsCode上运行项目,在安装npm依赖的时候,出现报错
npm ERR! code 1
npm ERR! Only Mac 64 bits supported.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/.../.npm/_logs/......
解决方法:将npm install
改为npm install --ignore-scripts
运行项目时执行命令npm run dev
出现:
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
具体报错:
Module build failed: Error: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Node.js 16.x
这是因为node-sass不支持当前M1的arm环境,解决如下(两种方式都可):
1. npm uninstall node-sass
npm install --save-dev sass
2. npm install node-sass@npm:sass