Vue-cli: Getting EUNSUPPORTEDPROTOCOL error when creating project

Created on 17 Aug 2020  ·  5Comments  ·  Source: vuejs/vue-cli

Version

4.5.3

Environment info

Environment Info:

  System:
    OS: macOS 10.15.5
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 8.11.1 - ~/.nvm/versions/node/v8.11.1/bin/node
    Yarn: Not Found
    npm: 5.6.0 - ~/.nvm/versions/node/v8.11.1/bin/npm
  Browsers:
    Chrome: 84.0.4147.125
    Edge: Not Found
    Firefox: 79.0
    Safari: 13.1.1
  npmGlobalPackages:
    @vue/cli: 4.5.3

Steps to reproduce

vue create my-project
select Default ([Vue 2] babel, eslint)

What is expected?

It should create a new vue project

What is actually happening?

I'm getting this error

Vue CLI v4.5.3
✨  Creating project in /Users/me/my-project.
🗃  Initializing git repository...
⚙️  Installing CLI plugins. This might take a while...

npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "npm:": npm:vue-loader@^16.0.0-beta.3

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/me/.npm/_logs/2020-08-17T18_49_36_738Z-debug.log
 ERROR  command failed: npm install --loglevel error

This was working fine a few days ago, not sure what happened.

Most helpful comment

I get this error with @vue/cli 4.5.4 and npm 6.14.8, any idea why?

All 5 comments

As a workaround, please use npm >= 6.9

When I implemented this https://github.com/vuejs/vue-cli/pull/5718
I tested with npm i @vue/cli-service under npm 5 and the failed installation of the optional dependency did not throw an error.

Turns out this only works with npm i + some specific package, not npm i along with a package.json.
So to support npm 5, we might need to turn the npm install call to several npm install some-package calls.

I get this error with @vue/cli 4.5.4 and npm 6.14.8, any idea why?

I get this same error with @vue/cli 4.5.4 and npm 6.10.3, exhausted

This fix my problem

npm install -g npm

Upgrade npm version

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mayefeng picture mayefeng  ·  44Comments

yyx990803 picture yyx990803  ·  80Comments

joeirimpan picture joeirimpan  ·  35Comments

xrei picture xrei  ·  40Comments

GeertClaes picture GeertClaes  ·  31Comments