日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學(xué)無(wú)先后,達(dá)者為師

網(wǎng)站首頁(yè) 編程語(yǔ)言 正文

npm WARN postcss-modules@4.2.2 requires a peer of postcss@^8.0.0 but none is installed. You must ins

作者:Yolanda_NuoNuo 更新時(shí)間: 2022-04-22 編程語(yǔ)言

問(wèn)題描述:
今天在安裝 vue-virtual-scroll-list
出現(xiàn)報(bào)錯(cuò)信息如下
npm WARN postcss-modules@4.2.2 requires a peer of postcss@^8.0.0 but none is installed. You must install peer dependencies yourself.
在這里插入圖片描述
其實(shí)不只是vue-virtual-scroll-list,有時(shí)候安裝其他的插件也會(huì)出現(xiàn)這個(gè)報(bào)錯(cuò),如果是按照?qǐng)?bào)錯(cuò)信息

npm install -g npm-install-peers

的話,也沒(méi)有用(我試過(guò)啦,親測(cè)不行)

后面在stackoverflow上找了一下
stackoverflow
發(fā)現(xiàn)可以這樣解決

看下自己的npm版本
在這里插入圖片描述
是6.14.14

升級(jí)到7版本

npm i -g npm@7

在這里插入圖片描述
就成功了

用這個(gè)方法需要注意一下,就是以前用6版本創(chuàng)建的項(xiàng)目,會(huì)報(bào)這個(gè)錯(cuò)
The package-lock.json file was created with an old version of npm

這樣的情況,我的處理辦法是,就,可以重新創(chuàng)建一下,把舊的依賴的配置文件和依賴包換掉。
或者再

npm i -g npm@6.14.14

裝回去,如果老項(xiàng)目還要跑的話。。。。。。

原文鏈接:https://blog.csdn.net/Yolanda_NuoNuo/article/details/120209039

欄目分類
最近更新