一、執(zhí)行 npm install 后報(bào)錯如下
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\AppData\Roaming\npm-cache\_logs\2023-02-10T01_10_40_226Z-debug.log
二、報(bào)錯原因
node.js 版本過高
Vue2 項(xiàng)目使用12開頭
的 Node.js版本 ,Vue3項(xiàng)目使用16開頭
的 Node.js 版本(我 Vue2 用 12.18.0,Vue3 用 16.14.0)
三、查看當(dāng)前 Node.js 版本號:
同時(shí)按下Win+R
鍵后輸入 cmd
,然后回車打開小黑窗,輸入 node -v
四、解決方法
方法一:重裝 Node (不推薦
)
不推薦這個(gè)方法
,想切換 node 版本又得卸載重裝,很不方便
第一步:卸載當(dāng)前 node
第二步:在官網(wǎng)下載合適的 node 版本,解壓并安裝
Node.js官網(wǎng):https://nodejs.org/zh-cn/download/releases/
文章來源:http://www.zghlxwxcb.cn/news/detail-655509.html
方法二: 安裝 nvm
安裝
nvm
管理 node.js 版本,實(shí)現(xiàn)多個(gè) node.js 版本輕松切換
nvm保姆級安裝教程:http://t.csdn.cn/5FRiy文章來源地址http://www.zghlxwxcb.cn/news/detail-655509.html
到了這里,關(guān)于npm 裝包報(bào)錯 npm ERR cb() never called npm ERR This is an error with npm itself. Please report this的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!