Vue-cli: Can't Reselect NPM or Yarn after first project creation

Created on 16 May 2018  路  8Comments  路  Source: vuejs/vue-cli

Version

3.0.0-beta.10

Reproduction link

https://codesandbox.io/s/vue

Steps to reproduce

  • install the vue-cli globally.
  • run vue create project-name
  • follow the steps.
  • It then asks you to select NPM or Yarn.
  • install project
  • create another project and the option for NPM or Yarn does not show again

What is expected?

Option to select the npm or yarn again when creating a project

What is actually happening?

just using the one you initially set, without an option to reset the initial option you selected


After this when creating a new vue project it will always use the package manager you originally set and not give you and option to select npm or yarn again. There is no way to reset this either. Uninstalling the package globally closing/opening the terminal does nothing either.

OS

macOS 10.13.4

Most helpful comment

Figured it out >_<.

there is a file in your home dir called .vuerc you can set the package manager there.

npm or yarn for e.g

{
  "useTaobaoRegistry": false,
  "packageManager": "npm"
}

All 8 comments

Same results ^

OS: Ubuntu 18.04

Further findings
You can manually set the package manager. by doing
vue create test --packageManager=npm

But we still need a way to reset the default. As if I go
vue create test it will try and use yarn (which I initially selected)

Figured it out >_<.

there is a file in your home dir called .vuerc you can set the package manager there.

npm or yarn for e.g

{
  "useTaobaoRegistry": false,
  "packageManager": "npm"
}

@jackiboy do you know what's the location of that file on Windows?
Does anyone know?

<Your home folder>/.vuerc. It's the same path on all OSes.

On Windows it's not know as Home folder, but User folder.
After some troubles you can find it by typing on cmd vue config. The command will show the path to the _.vuerc_ file (most likely in C:\Users\user_name\.vuerc) along with its content.

For the location, I just searched the file name .vuerc in C folder.

There's no .vuerc in my user home folder !!! (whenever vue config show /home/<user_name>/.vuerc )

Was this page helpful?
0 / 5 - 0 ratings

Related issues

OmgImAlexis picture OmgImAlexis  路  3Comments

BusyHe picture BusyHe  路  3Comments

jgribonvald picture jgribonvald  路  3Comments

wahidrahim picture wahidrahim  路  3Comments

joshuajohnson814 picture joshuajohnson814  路  3Comments