Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Reselect NPM or Yarn after first project creation #1300

Closed
jackiboy opened this issue May 16, 2018 · 14 comments
Closed

Can't Reselect NPM or Yarn after first project creation #1300

jackiboy opened this issue May 16, 2018 · 14 comments

Comments

@jackiboy
Copy link

jackiboy commented May 16, 2018

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

@johnpyp
Copy link

johnpyp commented May 16, 2018

Same results ^

OS: Ubuntu 18.04

@jackiboy
Copy link
Author

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)

@jackiboy
Copy link
Author

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"
}

@Akryum Akryum closed this as completed May 16, 2018
@L4ZZA
Copy link

L4ZZA commented May 5, 2019

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

@Akryum
Copy link
Member

Akryum commented May 5, 2019

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

@L4ZZA
Copy link

L4ZZA commented May 6, 2019

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.

@danishsshaikh
Copy link

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

@booluw booluw mentioned this issue Aug 9, 2020
@annymosse
Copy link

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

@jpuljko
Copy link

jpuljko commented Apr 10, 2021

I thought the .vuerc file wasn't there either, but then I realized it was just hidden.

@annymosse
Copy link

I thought the .vuerc file wasn't there either, but then I realized it was just hidden.

for my case i don't have it even inside my hidden files i check it since longtime ago ,even right now i don't have it

>ls -a ~ 
....                 .vmodules
.nix-defexpr         .vmware
.nix-profile         .vscode
.node_repl_history   .wget-hsts
.npm                 .wine
.npmrc               ....

@jpuljko
Copy link

jpuljko commented Apr 14, 2021

I thought the .vuerc file wasn't there either, but then I realized it was just hidden.

for my case i don't have it even inside my hidden files i check it since longtime ago ,even right now i don't have it

>ls -a ~ 
....                 .vmodules
.nix-defexpr         .vmware
.nix-profile         .vscode
.node_repl_history   .wget-hsts
.npm                 .wine
.npmrc               ....

vuerc
Well if it helps any, I'm on Windows and I used the File Explorer. It didn't seem to be there at first, but then when I started writing the path for it, it just appeared as you can see in the picture I attached.

@annymosse
Copy link

vuerc
Well if it helps any, I'm on Windows and I used the File Explorer. It didn't seem to be there at first, but then when I started writing the path for it, it just appeared as you can see in the picture I attached.

As Windows i think you have it however for linux (deepin-20.2 & ubuntu-20.10) i don't have it ,instead of it i've .pnpmrc & .yarnrc. @jpuljko i think there's an issue related to the Linux part on how to treat it.

@CrispenGari
Copy link

Changing the default package manager.

On windows open your C drive it can be see or whatever in my case it is C. Locate Users folder open the current user folder. You will find a file called .vuerc edit the file and change where it says packageManager to whatever package manager you are using. It can be yarn or npm. This is how the .vuerc looks like:

{
  "useTaobaoRegistry": false,
  "packageManager": "yarn",
  "latestVersion": "4.5.13",
  "lastChecked": 1628973271045,
  "presets": {
    "vue-ts": {
      "useConfigFiles": true,
      "plugins": {
        "@vue/cli-plugin-typescript": {
          "classComponent": false
        },
        "@vue/cli-plugin-router": {
          "historyMode": false
        },
        "@vue/cli-plugin-vuex": {},
        "@vue/cli-plugin-eslint": {
          "config": "prettier",
          "lintOn": [
            "save"
          ]
        }
      },
      "vueVersion": "2"
    }
  }
}

Selecting the package manager during project creation.

Note You can select the package manager you want to use during project creation when using the vue-cli by running the command vue create <app name> with the --packageManager flag for example:

vue create <app_name> --packageManager=yarn

@Bastich-dev
Copy link

You can see your Vue config with
vue config

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

You can edit your Vue config object with :
vue config -s <KEY> <VALUE>

So, for setup npm as default Package manager for Vue :
vue config -s packageManager npm

More Vue config:
vue config -h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants