【问题标题】:Getting error while running npm-check-updates运行 npm-check-updates 时出错
【发布时间】:2021-12-22 01:57:00
【问题描述】:

我在尝试执行以下命令时遇到错误

npm-check-updates

内部/模块/cjs/loader.js:905 抛出错误; ^

错误:找不到模块“../../package.json” 需要堆栈:

  • C:\Users\hbarsainya\AppData\Roaming\npm\node_modules\npm-check-updates\build\src\bin\cli.js
    在 Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    在 Function.Module._load (internal/modules/cjs/loader.js:746:27)
    在 Module.require (internal/modules/cjs/loader.js:974:19)
    在需要(内部/模块/cjs/helpers.js:92:18)
    在对象。 (C:\Users\hbarsainya\AppData\Roaming\npm\node_modules\npm-check-updates\build\src\bin\cli.js:11:40)
    在 Module._compile (internal/modules/cjs/loader.js:1085:14)
    在 Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    在 Module.load (internal/modules/cjs/loader.js:950:32)
    在 Function.Module._load (internal/modules/cjs/loader.js:790:14)
    在 Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
    代码:'MODULE_NOT_FOUND',
    要求堆栈:[
    'C:\Users\hbarsainya\AppData\Roaming\npm\node_modules\npm-check-updates\build\src\bin\cli.js'
    ]
    }

我看到位置 C:\Users\hbarsainya\AppData\Roaming\npm\node_modules\npm-check-updates\build\src\bin\cli.js 存在。你能帮我解决这个错误吗?

【问题讨论】:

    标签: node.js angular npm


    【解决方案1】:

    我在位置https://github.com/raineorshine/npm-check-updates/issues/990找到了解决方法

    我在 /home/ledsun/.local/share/nvm/v17.0.1/lib/ 中将“../../package.json”更改为“../../../package.json” node_modules/npm-check-updates/build/src/bin/cli.js:11,然后ncu按预期运行。

    【讨论】:

      猜你喜欢
      • 2017-06-11
      • 2019-11-25
      • 1970-01-01
      • 2021-07-27
      • 2018-06-14
      • 2019-07-24
      • 2020-01-11
      • 1970-01-01
      • 2018-11-22
      相关资源
      最近更新 更多