Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vue-cli 3: "command failed: npm install --loglevel error"

Tags:

Every time I try to create a new project (vue create my-project), I get this error:

ERROR : command failed: npm install --loglevel error

I'm on PC / Windows 10, Vue-cli 3.2.1, Node 8.11.3, Npm 5.6.0. Presets: Babel, ESLint & Prettier, SASS, Vue router, Vuex

From the log:

2736 silly saveTree `-- [email protected]

2737 warn [email protected] requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.

2738 verbose stack Error: EINVAL: invalid argument, read

Any idea what that means and how to solve it?

EDIT: I figured out that excluding any lint feature makes the problem disappear. So the question becomes: how can I still use linting and make it work?

enter image description here

like image 695
drake035 Avatar asked Dec 26 '18 16:12

drake035


1 Answers

Try

npm cache clean --force  

If it doesn't work then manually delete %appdata%\npm-cache folder. Then try to create the project again.

like image 104
Muskan Gupta Avatar answered Sep 28 '22 05:09

Muskan Gupta