下载的vue3模板用到了pnpm,就安装了一下
但是安装之后使用pnpm install 就发现包全被移动到ignored文件夹下面了,还报错
javascript
PS G:\Projects\gitProeject\TS_front> pnpm install
WARN Moving @commitlint/config-conventional that was installed by a different package manager to "node_modules/.ignored"
WARN Moving @commitlint/cli that was installed by a different package manager to "node_modules/.ignored"
WARN Moving @eslint/js that was installed by a different package manager to "node_modules/.ignored"
WARN Moving @commitlint/types that was installed by a different package manager to "node_modules/.ignored"
WARN Moving @faker-js/faker that was installed by a different package manager to "node_modules/.ignored"
WARN 76 other warnings
MODULE_NOT_FOUND Cannot find module 'G:\Projects\gitProeject\TS_front\node_modules\pnpm\dist\worker.js'
看报错原因说使用了两个不同的包管理器,那应该怎么办呢?
把node_modules删除
配置pnpm,之前只是安装了,但没有配置,所以无法识别pnpm命令
通过npm安装,安装好的pnpm在node_module下面,感觉不能用的亚子
bin 文件夹下面只有这个文件,既没有exe文件也没有cmd文件
通过下面的命令安装成功了
把pnpm.exe所在目录的路径添加到环境变量里面了
javascript
npm install -g @pnpm/exe
耶斯!终于成功了!