一个 Vue 项目从一台电脑上传到 github 上之后,再另外一台电脑上 git clone 。并使用 npm run dev 或 npm run start 发生以下报错的解决方法。

 
Vue 项目在其他电脑 npm run dev 运行报错的解决方法

 

报错原因

缺少 node_modules 里面的依赖。在项目目录下使用 npm install
然后再 npm run dev
如果在这一步当中, npm install 执行的过程中,处于一直卡顿的状态。说明网络状况不佳。建议使用 cnpm 淘宝源。

 

淘宝源

使用 cnpm -v 查看是否已经安装 cnpm。如果没有,使用 npm install cnpm -g --registry=https://registry.npm.taobao.org 命令安装。然后将上面 npm 的步骤命令改成 cnpm 即可。

相关文章:

  • 2022-12-23
  • 2021-08-30
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-08
  • 2022-12-23
  • 2021-11-03
  • 2021-10-15
  • 2021-04-17
  • 2022-12-23
  • 2021-12-25
相关资源
相似解决方案