刚刚将 npm
小更新到最新版本(我不记得它是什么,因为 npm
不再有效 - 因此问题)但我认为我的更新前安装的版本是5.6.0。但这可能是错误的。
无论如何在运行之后......
sudo npm install -g npm
... npm
根本不再有效。我所做的任何事情都会导致:
internal/modules/cjs/loader.js:596
throw err;
^
Error: Cannot find module './auth.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
at Function.Module._load (internal/modules/cjs/loader.js:520:25)
at Module.require (internal/modules/cjs/loader.js:650:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-fetch/index.js:7:17)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
有什么建议吗?
最佳答案
在尝试了一些不同的方法之后,包括通过 brew 重新安装 Node ,唯一有效的方法是从 node site 下载并运行 Node 安装程序二进制文件。 .
希望对其他人有帮助。
关于node.js - 更新后 NPM 死机 - 找不到模块 (OSX),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55050060/