下载的vue3模板用到了pnpm,就安装了一下
但是安装之后使用pnpm install 就发现包全被移动到ignored文件夹下面了,还报错
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所在目录的路径添加到环境变量里面了
npm install -g @pnpm/exe
文章来源:https://www.toymoban.com/news/detail-852132.html
耶斯!终于成功了!文章来源地址https://www.toymoban.com/news/detail-852132.html
到了这里,关于npm怎么迁移到pnpm的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!