vue cli3 创建项目时出错

报错如下

Vue CLI v3.0.4
  Creating project in C:\Users\25677\Desktop\study\vuedemo\vuex-demo.
  Installing CLI plugins. This might take a while...

npm ERR! Unexpected end of JSON input while parsing near '...t":false,"tarball":"h'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\25677\AppData\Roaming\npm-cache\_logs\2018-10-08T04_57_19_539Z-debug.log
 ERROR  command failed: npm install --loglevel error --registry=https://registry.npm.taobao.org --disturl=https://npm.taobao.org/dist
PS C:\Users\25677\Desktop\study\vuedemo>

第一次我是降低了npm版本,解决了问题,第二次又遇到了这个问题我是清空了npm缓存解决了;

现在看到了这种方法,觉得简单暴力,卸载所有,清除缓存,重来一次就好

npm uninstall -g vue
npm uninstall -g vue-cli
npm uninstall -g @vue/cli
npm cache clean --force
npm install -g @vue/cli

由于我没用2.多的脚手架了,现在直接使用这个方法了。

以上步骤后正常运行。

https://github.com/vuejs/vue-cli/issues/889

这个连接是很多遇到这个问题的人在上面提问和解决方法的。

猜你喜欢

转载自blog.csdn.net/qq_40285497/article/details/82966767
今日推荐