每次打开终端时都会出现此错误,每次尝试某些命令时也会出现此错误。我尝试通过从计算机中完全删除 node 和 npm 来修复它,但它仍然出现。我使用“locate”检查了“internal/modules/cjs/loader.js”文件,但我的计算机上没有它。在我将 Ubuntu 从 Ubuntu 16 或 14 更新到 18.04.3 LTS 后出现了此错误,我不记得具体时间了。
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module '/home/rzone/bash'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
如果我进入文件夹 ~/Downloads
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module '/home/rzone/Downloads/bash'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
如果我尝试节点命令
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module '/home/rzone/Downloads/node'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
如果我尝试 rvm 命令也是一样(在升级 Ubuntu 之前我已经安装了 Ruby 版本管理器)
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module '/home/rzone/Downloads/bash'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)