Vue-cli: “ERROR command failed: npm install --loglevel error” when trying to do “vue create”

Created on 9 Dec 2018  ·  16Comments  ·  Source: vuejs/vue-cli

Version

3.2.1

Environment info

  System:
    OS: Linux 4.18 Ubuntu 18.10 (Cosmic Cuttlefish)
    CPU: (1) x64 Intel(R) Xeon(R) CPU @ 2.30GHz
  Binaries:
    Node: 10.14.1 - /usr/bin/node
    Yarn: Not Found
    npm: 6.4.1 - /usr/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmPackages:
    @vue/babel-preset-app:  3.2.0 
    @vue/cli-overlay:  3.2.0 
    @vue/cli-plugin-babel: ^3.2.0 => 3.2.0 
    @vue/cli-plugin-eslint: ^3.2.0 => 3.2.1 
    @vue/cli-service: ^3.2.0 => 3.2.0 
    @vue/cli-shared-utils:  3.2.0 
    @vue/component-compiler-utils:  2.3.0 
    @vue/preload-webpack-plugin:  1.1.0 
    @vue/web-component-wrapper:  1.2.0 
    babel-helper-vue-jsx-merge-props:  2.0.3 
    babel-plugin-transform-vue-jsx:  4.0.1 
    eslint-plugin-vue:  4.7.1 
    vue-eslint-parser:  2.0.3 
    vue-hot-reload-api:  2.3.1 
    vue-loader:  15.4.2 
    vue-style-loader:  4.1.2 
    vue-template-es2015-compiler:  1.6.0 
  npmGlobalPackages:
    @vue/cli: 3.2.1

Steps to reproduce

vue create portfolio

What is expected?

Start a new Vue project.

What is actually happening?

Vue CLI v3.2.1
✨  Creating project in /home/mcaubrey511/portfolio.
🗃  Initializing git repository...
⚙  Installing CLI plugins. This might take a while...


> [email protected] install /home/mcaubrey511/portfolio/node_modules/yorkie
> node bin/install.js


ERROR  command failed: npm install --loglevel error

Most helpful comment

Having this same issue as well, already tried everything from https://github.com/vuejs/vue-cli/issues/889

node: v8.11.2
npm: 6.5.0
osx: 10.13.6

All 16 comments

After switching the machine I was using to Ubuntu 18.04 LTS I am no longer having the problem, so perhaps it's an issue specific to Ubuntu 18.10?

I'm having the same problem with same error message too when trying to create new or run npm install in existing project. I'm using Node 11 within docker and until now never had any problems creating projects with vue-cli.

Having this same issue as well, already tried everything from https://github.com/vuejs/vue-cli/issues/889

node: v8.11.2
npm: 6.5.0
osx: 10.13.6

Well this was the problem I also faced. But I found that you can install it using yarn.
yarn global add @vue/cli
and then create project using the code
vue create YourProjectName
Then after that cd into the project and run yarn server by yarn serve.

I am having this problem when compiling inside a snapcraft environment

https://github.com/vuejs/vue-cli/issues/3466#issuecomment-465049470
Did you run these commands as root or with sudo?

The same issue!

Check issue #889.

I'm coming up against this issue specifically when using Yarn, NPM is working fine but Yarn keeps throwing this damn error, googling I haven't found anything out either, tearing my hair out trying to get this to work, never used to have problems!

我也遇到这个问题,我的解决方式是,以管理员身份运行,就可以了

Closing this because the original issue is no longer reproducible, and the later ones are likely to be caused by permission issues https://cli.vuejs.org/guide/troubleshooting.html#running-installation-with-sudo-or-as-root

What worked for me:

Not trying to vue create projectname in a Google Drive "G:" drive directory.

Solution: runing vue create projectname in a C:\ drive directory.

I'm running Windows 10.

I hope this helps someone.

thanks.
it worked!

#3466 (comment)
Did you run these commands as root or with sudo?

yes what is solution for this

Closing this because the original issue is no longer reproducible, and the later ones are likely to be caused by permission issues https://cli.vuejs.org/guide/troubleshooting.html#running-installation-with-sudo-or-as-root

this is not working for me. Can you suggest any another way please

I was having the same issue using Ubuntu 18.04, and could solve by uninstalling vue using NPM and then installing it again using YARN.

Commands to uninstall vue:

sudo npm uninstall -g vue
sudo npm uninstall -g vue-cli
sudo npm uninstall -g @vue/cli

Install yarn: https://classic.yarnpkg.com/en/docs/install/#debian-stable

Then proceed to create app vue create my-app and install the preset also using yarn.

Was this page helpful?
0 / 5 - 0 ratings