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

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

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 15
  • Comments: 30

Most upvoted comments

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)
···

Really thanks https://github.com/vuejs/vue-cli/issues/6476#issuecomment-1137174677 Fixed via

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

Works great for me.

Any update for pnpm@7?

vue create vue-demo -m npm

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

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

This is still a problem

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

@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.

@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.

@linghengqian @cl1107 This error is still happening.

Vue CLI v5.0.8 pnpm 7.11.0

Same issue still occurs

Really thanks #6476 (comment) Fixed via

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

Works great for me.

@quyctd

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