当我安装任何npm包装时,例如:npm我lodash,npm我bcrypt显示类似这样的错误
Error: Cannot find module '../lib/utils/unsupported.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:19:21
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:153:3)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
internal/modules/cjs/loader.js:582
throw err;
答案 0 :(得分:3)
适用于OSX的版本:
rm -rf /usr/local/lib/node_modules
brew reinstall node
答案 1 :(得分:0)
尝试删除文件夹%USERPROFILE%\AppData\Roaming\npm\
,然后再次使用命令。您可能需要重新安装节点。
答案 2 :(得分:0)
尝试一下