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

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

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

macOS 升級(jí)后 nvm 安裝的 node 和 npm 出錯(cuò)

作者:rrdawlx 更新時(shí)間: 2022-01-13 編程語(yǔ)言

macOS 升級(jí)后,發(fā)現(xiàn)用 nvm 安裝的 node 和 npm 命令全都沒(méi)了,打開(kāi)命令行工具的時(shí)候會(huì)有如下錯(cuò)誤提示:

internal/modules/cjs/loader.js:583
    throw err;
    ^

Error: Cannot find module 'ansi-regex'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/rrdawlx/.nvm/versions/node/v10.10.0/lib/node_modules/npm/node_modules/strip-ansi/index.js:2:17)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
nvm is not compatible with the npm config "prefix" option: currently set to ""
Run `nvm use --delete-prefix v10.10.0 --silent` to unset it.

解決方法是先刪除已安裝的 node 版本,比如nvm uninstall v10.10.0;然后重新安裝 node,比如nvm install node

原文鏈接:https://blog.csdn.net/wlx1991/article/details/83990280

欄目分類(lèi)
最近更新