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

vue add doesn't work with pnpm 6,report Error command failed:pnpm install --reporter silent --shamefully-hoist vue-cli-plugin-windicss -D #6476

Closed
cl1107 opened this issue May 13, 2021 · 30 comments

Comments

@cl1107
Copy link

cl1107 commented May 13, 2021

Version

4.5.13

Environment info

Environment Info:

  System:
    OS: macOS 11.3.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 14.16.1 - ~/.nvm/versions/node/v14.16.1/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.12 - ~/.nvm/versions/node/v14.16.1/bin/npm
  Browsers:
    Chrome: 90.0.4430.93
    Edge: 90.0.818.56
    Firefox: 87.0
    Safari: 14.1
  npmPackages:
    @vue/cli-plugin-babel: ~4.5.0 => 4.5.13 
    @vue/cli-plugin-eslint: ~4.5.0 => 4.5.13 
    @vue/cli-service: ~4.5.0 => 4.5.13 
    eslint-plugin-vue: ^6.2.2 => 6.2.2 
    vue: ^2.6.11 => 2.6.12 
    vue-cli-plugin-windicss: ~0.2.0 => 0.2.0 
    vue-eslint-parser:  7.6.0 
    vue-template-compiler: ^2.6.11 => 2.6.12 
  npmGlobalPackages:
    @vue/cli: 4.5.13

Steps to reproduce

1.vue create tailing
2、rm -fr node_module
3、pnpm i
4、vue add windicss

What is expected?

add windicss successfully

What is actually happening?

ERROR command failed: pnpm install --reporter silent --shamefully-hoist vue-cli-plugin-windicss -D

@stav
Copy link

stav commented Sep 10, 2021

I have similar error

Version

4.5.13

Environment info

Environment Info:

  System:
    OS: Linux 5.0 Ubuntu 19.04 (Disco Dingo)
    CPU: (4) x64 Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
  Binaries:
    Node: 14.17.3 - ~/.nvm/versions/node/v14.17.3/bin/node
    Yarn: 1.21.1 - /usr/bin/yarn
    npm: 7.21.1 - ~/.nvm/versions/node/v14.17.3/bin/npm
    pnpm: 6.14.6 - ~/.nvm/versions/node/v14.17.3/bin/pnpm
  Browsers:
    Chrome: 91.0.4472.114
    Firefox: 72.0.1
  npmPackages:
    @vitejs/plugin-vue: ^1.6.1 => 1.6.2
    @vue/compiler-sfc: ^3.2.6 => 3.2.11
    vue: ^3.2.6 => 3.2.11
  npmGlobalPackages:
    @vue/cli: 4.5.13

Steps to reproduce

  1. vue add @vue/cli-plugin-eslint

What is expected?

add eslint plugin successfully

What is actually happening?

ERROR command failed: pnpm install --reporter silent --shamefully-hoist @vue/cli-plugin-eslint@~4.5.0 -D

Try to run pnpm command manually

$ pnpm install --reporter --shamefully-hoist @vue/cli-plugin-eslint@~4.5.0 -D

ERROR This modules directory was created using a different public-hoist-pattern value.
Run "pnpm install" to recreate the modules directory.

$ pnpm i
Lockfile is up-to-date, resolution step is skipped
Already up-to-date

@hellorayza
Copy link

similar too.

Version

4.5.15

Environment Info:

  System:
    OS: Windows 10 10.0.22000
    CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
  Binaries:
    Node: 14.6.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.11 - C:\Program Files\nodejs\yarn.CMD
    npm: 6.14.6 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Spartan (44.22000.120.0), Chromium (96.0.1054.34)
  npmPackages:
    @vue/cli-plugin-babel: ^3.8.0 => 3.12.1
    @vue/cli-plugin-eslint: ^3.8.0 => 3.12.1
    @vue/cli-service: ^3.8.0 => 3.12.1
    @vue/eslint-config-standard: ^4.0.0 => 4.0.0
    eslint-plugin-vue: ^5.0.0 => 5.2.3
    vue: ^2.6.10 => 2.6.14
    vue-cropper: ^0.4.9 => 0.4.9
    vue-eslint-parser:  5.0.0
    vue-router: ^3.0.3 => 3.5.3
    vue-template-compiler: ^2.6.10 => 2.6.14
    vuex: ^3.0.1 => 3.6.2
  npmGlobalPackages:
    @vue/cli: Not Found   // installed by pnpm, pnpm list -g show @vue/cli 4.5.15

Steps to reproduce

git clone project
pnpm i
vue upgrade

What is expected?

upgrade successfully.

What is actually happening?

got :

 ERROR  command failed: pnpm install --reporter silent --shamefully-hoist @vue/cli-service@~4.5.15

Any additional comments? (optional)

add .npmrc file

shamefully-hoist=true

@agileago
Copy link

same as vue-cli v5

Upgrading @vue/cli-service from 4.5.15 to 5.0.0-rc.1
 ERROR  Error: command failed: pnpm install --reporter silent --shamefully-hoist @vue/cli-service@~5.0.0-rc.1
Error: command failed: pnpm install --reporter silent --shamefully-hoist @vue/cli-service@~5.0.0-rc.1
    at ChildProcess.<anonymous> (/Users/jianhuaren/.nvm/versions/node/v16.9.1/pnpm-global/5/node_modules/.pnpm/@vue+cli@5.0.0-rc.1/node_modules/@vue/cli/lib/util/executeCommand.js:138:16)
    at ChildProcess.emit (node:events:394:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

@EricHier
Copy link

EricHier commented Jan 9, 2022

any ideas why this does not work?

@amiria703
Copy link

As a workaround I renamed node_modules/.modules.yaml to node_modules/.modules.yaml_bak
and then rerun the command
Related: pnpm/pnpm#3600

@zbyju
Copy link

zbyju commented Apr 10, 2022

This is still a problem

1 similar comment
@dkl78167816
Copy link

This is still a problem

@rnmeow
Copy link

rnmeow commented May 1, 2022

package.json with pnpm is incompleted...

@Shion1305
Copy link

Same problem happened to me when I run vue create **project-name**
I switched from pnpm to npm by appending -m npm option

@sujianqingfeng
Copy link

sujianqingfeng commented May 6, 2022

pnpm 7.0.0 Same problem

[I] ➜ vue create xxxxxx


Vue CLI v5.0.4
? Please pick a preset: Default ([Vue 2] babel, eslint)


Vue CLI v5.0.4
✨  Creating project in /home/hens/work-space/xxxxxxx.
🗃  Initializing git repository...
⚙️  Installing CLI plugins. This might take a while...

 ERROR  Error: command failed: pnpm install --reporter silent --shamefully-hoist
Error: command failed: pnpm install --reporter silent --shamefully-hoist
    at ChildProcess.<anonymous> (/home/hens/.nvm/versions/node/v16.15.0/lib/node_modules/@vue/cli/lib/util/executeCommand.js:138:16)
    at ChildProcess.emit (node:events:527:28)
    at maybeClose (node:internal/child_process:1092:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
···

@fangxndoit
Copy link

vue create vue-demo -m npm

@Gsonovb
Copy link

Gsonovb commented May 25, 2022

I set up a test environment in a container

node v16
Vue/cli 5.04

Using the PNPM 7.x version causes an error,

PNPM 6.32.14 can successfully create a project

@vishesh-baj
Copy link

I am having same issue with apple m1 macbook air, 8 gb ram

@rnmeow
Copy link

rnmeow commented May 30, 2022

Really thanks #6476 (comment)
Fixed via

$ npm i pnpm@6 -g
$ vue create PROJECT

Works great for me.

@quyctd
Copy link

quyctd commented Jul 12, 2022

Any update for pnpm@7?

@SVafadar69
Copy link

Really thanks #6476 (comment) Fixed via

$ npm i pnpm@6 -g
$ vue create PROJECT

Works great for me.

@quyctd

@ssergeevichh
Copy link

vue create vue-demo -m npm
good solution, also recommend

@ayu-exorcist
Copy link

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

More:

  • if (packageManager === 'pnpm') {
    const pnpmConfig = hasPnpmVersionOrLater('4.0.0')
    ? 'shamefully-hoist=true\n'
    : 'shamefully-flatten=true\n'
    await writeFileTree(context, {
    '.npmrc': pnpmConfig
    })
    }
  • const PACKAGE_MANAGER_PNPM4_CONFIG = {
    install: ['install', '--reporter', 'silent', '--shamefully-hoist'],
    add: ['install', '--reporter', 'silent', '--shamefully-hoist'],
    upgrade: ['update', '--reporter', 'silent'],
    remove: ['uninstall', '--reporter', 'silent']
    }
    const PACKAGE_MANAGER_PNPM3_CONFIG = {
    install: ['install', '--loglevel', 'error', '--shamefully-flatten'],
    add: ['install', '--loglevel', 'error', '--shamefully-flatten'],
    upgrade: ['update', '--loglevel', 'error'],
    remove: ['uninstall', '--loglevel', 'error']
    }

@Adzetko
Copy link

Adzetko commented Aug 23, 2022

I have vue-cli v5.0.8 and pnpm 7.8.0 and I can confirm this issue. I want to be able to use pnpm on my project because I have an old ADSL which speeds are concerning, and I was relived to see vue-cli has compatibility for pnpm. However it seems broken?

Error: command failed: pnpm install --reporter silent --shamefully-hoist
   at ChildProcess.<anonymous> (/usr/lib/node_modules/@vue/cli/lib/util/executeCommand.js:138:16)
   at ChildProcess.emit (node:events:513:28)
   at maybeClose (node:internal/child_process:1093:16)
   at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)

@linghengqian
Copy link

This issue was fixed in #7265 and should be closed.

@cl1107
Copy link
Author

cl1107 commented Sep 5, 2022

This issue was fixed in #7265 and should be closed.

@cl1107 cl1107 closed this as completed Sep 5, 2022
@WangNingning1994
Copy link

Same issue still occurs

@beierzhijin
Copy link

Same issue still occurs

有人已经解决了这个问题,是因为pnpm v7默认的配置导致的,vue 官方人员已经merge该commit到dev分支了,应该会在下一个版本发布时修复

@JFGHT
Copy link

JFGHT commented Sep 22, 2022

@linghengqian @cl1107
This error is still happening.

Vue CLI v5.0.8
pnpm 7.11.0

@linghengqian
Copy link

linghengqian commented Sep 22, 2022

@linghengqian @cl1107
This error is still happening.

Vue CLI v5.0.8
pnpm 7.11.0

  • Make sure you are using the dev branch, not 5.0.8.

@JFGHT
Copy link

JFGHT commented Sep 22, 2022

@linghengqian @cl1107
This error is still happening.
Vue CLI v5.0.8
pnpm 7.11.0

  • Make sure you are using the dev branch, not 5.0.8.

That was fast. I assume this is because it isn't released yet?

@linghengqian
Copy link

@linghengqian @cl1107
This error is still happening.
Vue CLI v5.0.8
pnpm 7.11.0

  • Make sure you are using the dev branch, not 5.0.8.

That was fast. I assume this is because it isn't released yet?

It has not been published to npm yet. You need to build the dev branch and hook into your local repo or private repo.

@bugproof
Copy link

@linghengqian @cl1107
This error is still happening.
Vue CLI v5.0.8
pnpm 7.11.0

  • Make sure you are using the dev branch, not 5.0.8.

and how do you use dev branch?

@Benleie
Copy link

Benleie commented Mar 21, 2023

@linghengqian @cl1107
This error is still happening.
Vue CLI v5.0.8
pnpm 7.11.0

  • Make sure you are using the dev branch, not 5.0.8.

That was fast. I assume this is because it isn't released yet?

It has not been published to npm yet. You need to build the dev branch and hook into your local repo or private repo.

same error in Vue CLI v5.0.8. How to hook into my repo?

@linghengqian
Copy link

@Benleie You need to complete yarn link according to https://github.com/vuejs/vue-cli/blob/dev/.github/CONTRIBUTING.md .

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