5

我尝试使用“npx 更新”。我完全不知道为什么我会收到这个错误,而且似乎甚至找不到一个起点。我唯一使用 npx 的是电容器(带有离子框架)。对此原因或修复的任何帮助或只是指出正确的方向都会有所帮助

C:\dev\p\bas>npx update
npx: installed 658 in 28.218s
[23:34:41] using file ~C:\Users\Hunter\AppData\Roaming\npm-cache\_npx\6000\node_modules\update\lib\updatefile.js
[23:34:41] starting update.default
[23:34:41] √ running: init

  Current updaters: init

 no updaters were saved.
[23:34:42] finished update.default √ 410ms
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'set-blocking'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at process.<anonymous> (C:\Users\Hunter\AppData\Roaming\npm-cache\_npx\6000\node_modules\update\bin\update.js:4:3)
    at process.emit (events.js:203:15)
    at process.exit (internal/process/per_thread.js:168:15)
    at C:\Users\Hunter\AppData\Roaming\npm-cache\_npx\6000\node_modules\update\bin\update.js:55:15
    at C:\Users\Hunter\AppData\Roaming\npm-cache\_npx\6000\node_modules\update\node_modules\base-generators\index.js:482:13
    at C:\Users\Hunter\AppData\Roaming\npm-cache\_npx\6000\node_modules\update\node_modules\async-each-series\index.js:15:40
4

2 回答 2

3

帮助我解决错误的是首先更新我的 npm 版本:

  1. npm install -g npm@latest
  2. npm install -g set-blocking
  3. npx update
于 2021-02-10T18:47:01.047 回答
1

只需运行 npm 命令即可安装缺少的模块:

npm install set-blocking

然后npx update再次运行

希望能帮助到你!:)

于 2020-03-27T11:11:54.400 回答