全局安装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.
方案
如果不想全局安装
把
pnpm add vite -D
改成
pnpm add vite -w
如果想继续全局安装
设置pnpm
pnpm config set ignore-workspace-root-check true
然后再安装
pnpm add vite -D
即可安装成功
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