node.js - 使用 npm 时找不到模块 'npmconf'

标签 node.js npm

我再次尝试安装/更新 npm。我也卸载了 npm,但我又遇到了同样的错误:

module.js:340
        throw err;
              ^ Error: Cannot find module 'npmconf'
        at Function.Module._resolveFilename (module.js:338:15)
        at Function.Module._load (module.js:280:25)
        at Module.require (module.js:364:17)
        at require (module.js:380:17)
        at Object.<anonymous> (/usr/local/lib/node_modules/npm/lib/config.js:16:15)
        at Module._compile (module.js:456:26)
        at Object.Module._extensions..js (module.js:474:10)
        at Module.load (module.js:356:32)
        at Function.Module._load (module.js:312:12)
        at Module.require (module.js:364:17)

最佳答案

我自己得到了答案。在这里:

git clone git://github.com/isaacs/npm.git
cd npm/scripts
chmod +x install.sh
sudo ./install.sh

关于node.js - 使用 npm 时找不到模块 'npmconf',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34939585/

相关文章:

node.js - VS Task Runner Explorer - Node Sass 找不到绑定(bind)

node.js - 升级node/npm后需要安装npm吗?

javascript - 类型错误 : callback is not a function -

node.js - 咕噜声扔 "Recursive process.nextTick detected"

node.js - 通过 Postman Newman 并行运行多个请求以对 API 进行负载测试

mysql - Angular Universal 中的异步 Node.js 请求。服务器渲染停止工作

javascript - 尝试为 Node.js 安装 npm 时出错

javascript - grunt.js 的全局安装失败

javascript - 如何在javascript函数中执行python代码(.py文件)?

node.js - mkdir -p 在 Windows 上的 package.json 脚本中不起作用