【问题标题】:Any npm command returns error "Cannot find module yallist" even npm -v任何 npm 命令都会返回错误“找不到模块 yallist”,甚至 npm -v
【发布时间】:2021-12-10 00:50:28
【问题描述】:

(节点:2564)UnhandledPromiseRejectionWarning:错误:找不到模块“yallist” 需要堆栈: - C:\Users\23354\AppData\Roaming\npm\node_modules\npm\node_modules\lru-cache\index.js - C:\Users\23354\AppData\Roaming\npm\node_modules\npm\node_modules\semver\classes\range.js - C:\Users\23354\AppData\Roaming\npm\node_modules\npm\node_modules\semver\classes\comparator.js - C:\Users\23354\AppData\Roaming\npm\node_modules\npm\node_modules\semver\index.js - C:\Users\23354\AppData\Roaming\npm\node_modules\npm\lib\utils\unsupported.js - C:\Users\23354\AppData\Roaming\npm\node_modules\npm\lib\cli.js - C:\Users\23354\AppData\Roaming\npm\node_modules\npm\bin\npm-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:93:18) 在对象。 (C:\Users\23354\AppData\Roaming\npm\node_modules\npm\node_modules\lru-cache\index.js:4:17) 在 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:12) 在 Module.require (internal/modules/cjs/loader.js:974:19) (使用node --trace-warnings ... 显示警告的创建位置) (节点:2564) UnhandledPromiseRejectionWarning:未处理的承诺拒绝。这个错误 起源于在没有 catch 块的异步函数内部抛出,或者由 拒绝未使用 .catch() 处理的承诺。终止节点进程 在未处理的 Promise 拒绝时,使用 CLI 标志 --unhandled-rejections=strict(请参阅 https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode)。 (拒绝编号:1) (节点:2564)[DEP0018] DeprecationWarning:不推荐使用未处理的承诺拒绝。 将来,未处理的 Promise 拒绝将终止 Node.js 具有非零退出代码的进程。

【问题讨论】:

    标签: npm


    【解决方案1】:

    我通过卸载node解决了这个问题,并删除了Roaming文件夹中的npm文件夹,然后重新启动了计算机。

    之后我再次安装了节点。现在一切正常。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-09-11
      • 2020-07-13
      • 2022-06-14
      • 1970-01-01
      • 1970-01-01
      • 2021-09-16
      • 2020-01-24
      相关资源
      最近更新 更多