当前位置:   article > 正文

pnpm add vite -D报错_running this command will add the dependency to th

running this command will add the dependency to the workspace root, which mi

全局安装vite报错

 ERR_PNPM_ADDING_TO_ROOT  Running this command will add the dependency to the workspace root, which might not be what you want - if you really meant it, make it explicit by running this command again with the -w flag (or --workspace-root). If you don't want to see this warning anymore, you may set the ignore-workspace-root-check setting to true.
  • 1

方案

如果不想全局安装

pnpm add vite -D
  • 1

改成

pnpm add vite -w
  • 1

如果想继续全局安装

设置pnpm

 pnpm config set ignore-workspace-root-check true  
  • 1

然后再安装

pnpm add vite -D   
  • 1

即可安装成功

Packages: +96
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 97, reused 1, downloaded 96, added 96, done
node_modules/.pnpm/esbuild@0.17.19/node_modules/esbuild: Running postinstall script, done in 423ms

devDependencies:
+ vite 4.3.9

Done in 16.9s
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/205272
推荐阅读
相关标签
  

闽ICP备14008679号