下載的vue3模板用到了pnpm,就安裝了一下
但是安裝之后使用pnpm install 就發(fā)現(xiàn)包全被移動到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'
看報錯原因說使用了兩個不同的包管理器,那應(yīng)該怎么辦呢?
把node_modules刪除
配置pnpm,之前只是安裝了,但沒有配置,所以無法識別pnpm命令
通過npm安裝,安裝好的pnpm在node_module下面,感覺不能用的亞子
bin 文件夾下面只有這個文件,既沒有exe文件也沒有cmd文件
通過下面的命令安裝成功了
把pnpm.exe所在目錄的路徑添加到環(huán)境變量里面了
npm install -g @pnpm/exe
文章來源:http://www.zghlxwxcb.cn/news/detail-852132.html
耶斯!終于成功了!文章來源地址http://www.zghlxwxcb.cn/news/detail-852132.html
到了這里,關(guān)于npm怎么遷移到pnpm的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!