vuejs / vue-cli

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

使用 pnpm 安装 vue create 会 报错 #7284

Open king-open opened 1 year ago

king-open commented 1 year ago

Version

5.0.8

Environment info

macos12.5  pnpm7.9.0

Steps to reproduce

vue create back

选择 pnpm 报错

What is expected?

正常能够使用pnpm构建项目依赖

What is actually happening?

安装使用pnpm 出现以下错误 command failed: pnpm install --reporter silent --shamefully-hoist --registry=https://registry.npmmirror.com/

king-open commented 1 year ago

Follow the tips my friend gave me

mkdir back && cd back && pnpm init && vue create . 

still wrong

king-open commented 1 year ago

I have tried to use create-vue in slowly getting used to

lvqq commented 1 year ago

You can add strict-peer-dependencies=false in .npmrc file and it may work

king-open commented 1 year ago

nope, same error

lvqq commented 1 year ago

Yeah, I just found it that the error interrupted the process of installing, and the next process of generating files wouldn't execute. So the method won't work, maybe another solution is to degrade pnpm to 6.x because the installing is build-in.

linghengqian commented 1 year ago

You can start a new line in .npmrc and add auto-install-peers=true. This works for pnpm v6 and pnpm v7. 👀

king-open commented 1 year ago

i try first

king-open commented 1 year ago

Wow, lowering pnpm to 6 works fine . amazing

king-open commented 1 year ago

thanks man

lvqq commented 1 year ago

You can start a new line in .npmrc and add auto-install-peers=true. This works for pnpm v6 and pnpm v7. 👀

That won't work because .npmrc file will be overwrite by cli🤣

king-open commented 1 year ago

Yeah

linghengqian commented 1 year ago

You can start a new line in .npmrc and add auto-install-peers=true. This works for pnpm v6 and pnpm v7. 👀

That won't work because .npmrc file will be overwrite by cli🤣

king-open commented 1 year ago

So if I add that sentence to .npmrc first, it's fine

linghengqian commented 1 year ago

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

king-open commented 1 year ago

ok thanks

Wang-zhetao commented 1 year ago

Why doesn't it work anymore

zkl00 commented 1 year ago

pnpm i 提示这个错误 no such file or directory, stat 'Users\admin\Desktop\demo\dome_vue3\node_modules.pnpm\jsdom@21.1.0\node_modules\decimal.js'

这是什么原因