我经常使用这个工具,从来没有见过这个。
Ubuntu 20.04
# npm install -g wscat
added 9 packages in 2s
root@simp:~# wscat
node:internal/modules/cjs/loader:988
throw err;
^
Error: Cannot find module 'debug'
Require stack:
- /usr/lib/x86_64-linux-gnu/nodejs/ws/node_modules/https-proxy-agent/index.js
- /usr/lib/x86_64-linux-gnu/nodejs/wscat/bin/wscat
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
at Function.Module._load (node:internal/modules/cjs/loader:833:27)
at Module.require (node:internal/modules/cjs/loader:1057:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (/usr/lib/x86_64-linux-gnu/nodejs/ws/node_modules/https-proxy-agent/index.js:11:13)
at Module._compile (node:internal/modules/cjs/loader:1155:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
at Module.load (node:internal/modules/cjs/loader:1033:32)
at Function.Module._load (node:internal/modules/cjs/loader:868:12)
at Module.require (node:internal/modules/cjs/loader:1057:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/lib/x86_64-linux-gnu/nodejs/ws/node_modules/https-proxy-agent/index.js',
'/usr/lib/x86_64-linux-gnu/nodejs/wscat/bin/wscat'
]
}
发布于 2023-03-28 18:00:53
我可以通过sudo npm install
in /usr/share/nodejs/wscat
来解决这个问题。不知道这是不是正确的方法。
https://unix.stackexchange.com/questions/730352
复制相似问题