启动vue项目时报错,npm ERR! Failed at the [email protected] postinstall script.

在启动vue项目的时候报错

报错信息如下:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

找不到sass,查看node-sass文件,里面没有文件。

所以在npm install前设置sass源。

解决方案:直接在当前目录下进行node-sass 的数据源设置

npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass

安装依赖:

# 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题

npm install --registry=https://registry.npm.taobao.org

# 启动服务

npm run dev

相关文章:

  • 2021-12-15
  • 2021-07-16
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-22
  • 2021-07-03
  • 2021-10-03
  • 2021-09-01
  • 2022-12-23
  • 2022-12-23
  • 2021-05-04
相关资源
相似解决方案