node一直用的10.x版本的,由于后期项目所需,更新到了项目14.x,然后启动老的项目报错
报错原因:
This usually happens because your environment has changed since running `npm install`. 这通常是因为运行“npm install”后环境发生了变化。
Run `npm rebuild node-sass` to download the binding for your current environment.运行“npm rebuild node sass”下载当前环境的绑定。
无法下载“node sass”,原因是:
ESOCKETTIMEDOUT
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
大概意思就是node-sass被墙掉了
解决办法使用淘宝镜像下载:
npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
运行后下载成功,然后启动项目就ok了