vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.76k stars 6.33k forks source link

vue add plugin error because --shamefully-hoist #6951

Open linghaoSu opened 2 years ago

linghaoSu commented 2 years ago

Version

5.0.0-rc.2

Environment info

Environment Info:

  System:
    OS: macOS 12.0.1
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
  Binaries:
    Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node
    Yarn: 1.22.4 - ~/.yarn/bin/yarn
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm
  Browsers:
    Chrome: Not Found
    Edge: Not Found
    Firefox: Not Found
    Safari: Not Found
  npmPackages:
    @vue/cli-plugin-babel: ~5.0.0-rc.2 => 5.0.0-rc.2 
    @vue/cli-plugin-e2e-cypress: ~5.0.0-rc.2 => 5.0.0-rc.2 
    @vue/cli-plugin-eslint: ~5.0.0-rc.2 => 5.0.0-rc.2 
    @vue/cli-plugin-router: ~5.0.0-rc.2 => 5.0.0-rc.2 
    @vue/cli-plugin-typescript: ~5.0.0-rc.2 => 5.0.0-rc.2 
    @vue/cli-plugin-unit-jest: ~5.0.0-rc.2 => 5.0.0-rc.2 
    @vue/cli-plugin-vuex: ~5.0.0-rc.2 => 5.0.0-rc.2 
    @vue/cli-service: ~5.0.0-rc.2 => 5.0.0-rc.2 
    @vue/eslint-config-airbnb: ^6.0.0 => 6.0.0 
    @vue/eslint-config-typescript: ^9.1.0 => 9.1.0 
    @vue/test-utils: ^2.0.0-0 => 2.0.0-rc.18 
    @vue/vue3-jest: ^27.0.0-alpha.1 => 27.0.0-alpha.4 
    eslint-plugin-vue: ^8.0.3 => 8.3.0 
    eslint-plugin-vuejs-accessibility: ^1.1.0 => 1.1.1 
    typescript: ~4.1.5 => 4.1.6 
    vue: ^3.2.13 => 3.2.26 
    vue-router: ^4.0.3 => 4.0.12 
    vuex: ^4.0.0 => 4.0.2 
  npmGlobalPackages:
    @vue/cli: 5.0.0-rc.2

Steps to reproduce

use pnpm install vue add i18n you will get error

Error: command failed: pnpm install --reporter silent --shamefully-hoist vue-cli-plugin-i18n -D
 ERR_PNPM_PUBLIC_HOIST_PATTERN_DIFF  This modules directory was created using a different public-hoist-pattern value. Run "pnpm install" to recreate the modules directory.

What is expected?

i dont want to use shamfully-hoist modules directory. dont force me to use --shamfully-hoist flag.

Why the --shamefully-hoist flag must be used in vue cli

What is actually happening?

when use vue add xxx, force to use 'pnpm install --reporter silent --shamefully-hoist vue-cli-plugin-i18n -D' image image

roiding commented 2 years ago

nobody to fix it?

ayu-exorcist commented 2 years ago
  1. cd your_project_path
  2. rm -rf .npmrc && rm -rf node_modules
  3. pnpm install
  4. pnpm add vue-cli-plugin-i18n -D
  5. pnpm add -D yorkie webpack @babel/core @types/node @types/webpack-env

More: