2

the command:

vue create vue-hello

the Error:

npm ERR! Unexpected end of JSON input while parsing near '...kwrap":false,"publish'

npm ERR! A complete log of this run can be found in: npm ERR! /Users/hope111/.npm/_logs/2018-05-27T03_02_46_740Z-debug.log ERROR command failed: npm install --loglevel error --registry=https://registry.npm.taobao.org --disturl=https://npm.taobao.org/dist

Here is the picture of the error:

picture of the error

I had used the npm cache clean --force, but it did not work

Cœur
  • 37,241
  • 25
  • 195
  • 267
zhengpq
  • 21
  • 1
  • 3

3 Answers3

2
  1. npm cache clean --force
  2. npm update
  3. npm install -g @vue/cli
Zoul Barizi
  • 369
  • 3
  • 12
0

According to this issue, it seems that updating to npm 6+ solves some vue-cli3.0.0-beta.11 bugs

dnhyde
  • 1,265
  • 2
  • 14
  • 24
  • I have updated my npm to 6.1.0 and vue-cli to 3.0.0-beta.11 but did not work, I have changed the vuejs-templates, now I am using this one : https://github.com/vuejs-templates/webpack – zhengpq May 27 '18 at 12:34
  • I have updated my npm to 6.1.0 and vue-cli to 3.0.0-beta.11 but did not work, I have changed the vuejs-templates, now I am using this one : https://github.com/vuejs-templates/webpack – zhengpq May 27 '18 at 12:34
  • You were not choosing any templates from vue-cli right? When you run `vue create my-project` the first thing I a am presented with is _"select a preset"_ and both _"Manually select features_" and _"default (bable, eslint)"_ work just fine. Sorry if I can't help further, last thing could be that some plugins cannot be downloaded on your connection as said [here](https://github.com/vuejs-templates/webpack/issues/990), that's why I would try the most basic configuration. – dnhyde May 27 '18 at 14:39
  • 1
    I chose the default preset when I run vue create my-project , but it show the above error, maybe it is my environment problem. In a word, thank you for answering my question! If I find a solution, I will tell you. – zhengpq May 28 '18 at 01:25
0

Maybe running these commands will solve it. It helped me with a similar problem when trying to create a new project with vue create

error: ~/.vuerc may be outdated. Please delete it and re-run vue-cli in manual mode.

solution:

$ npm uninstall -g vue

$ npm uninstall -g vue-cli

$ npm uninstall -g @vue/cli

$ npm cache clean --force

$ npm install -g vue

$ npm install -g @vue/cli