node.js - NPM 模块.js :472

标签 node.js linux ubuntu npm node-modules

当我尝试启动任何 npm 命令时,终端显示

module.js:472
    throw err;
    ^

Error: Cannot find module '/usr/lib/node_modules/npm/bin/node_modules/npm/bin/npm-cli.js'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:425:7)
    at startup (bootstrap_node.js:146:9)
    at bootstrap_node.js:540:3

我尝试重新安装 node.jsnpm。 如何以及在哪里可以将目录“usr/lib/node_modules/npm/bin/node_modules/npm/bin/npm-cli.js”更改为“usr/bin/node_modules/npm/bin/npm-cli.js”。

附注当我将所有 node_modules 和 past 复制到/node_modules/npm/bin/时,它可以工作,但这不是一个可接受的解决方案。

最佳答案

在您的项目文件夹中,有一个名为 webpack.local.settings.js.sample 的文件。将文件重命名为 webpack.local.settings.js 它对我有用。

关于node.js - NPM 模块.js :472,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42599584/

相关文章:

zend-framework - 在 ubuntu 上安装错误的 zend 框架

linux - VIM:如何在 Ubuntu 上精确到行

javascript - NodeJS 计算数组中有多少个对象?

node.js - 如何使用回调填充 Mongoose 中的schemaref?

node.js - 如何在不中断服务的情况下部署更改?

Linux startx qt 边框

linux - 安装后的 OpenLDAP 管理员密码

javascript - Google Identity 工具包验证 IdToken 时出错(客户端 : Android, 后端 : Node. js)

c# - 在 ASP .NET CORE 中更新 Web 应用程序替换文件或删除文件,更新时如何在应用程序中保留文件

c - 如果 getaddrinfo 失败一次,它将永远失败(即使在网络准备就绪之后)