我当前正在运行Centos 6 Linux,并且尝试安装节点模块。这是我得到的错误:
Error: spawn ENOMEM
at ChildProcess.spawn (internal/child_process.js:366:11)
at spawn (child_process.js:551:9)
at Object.execFile (child_process.js:221:15)
at uidNumber (/usr/lib/node_modules/npm/node_modules/uid-number/uid-number.js:33:17)
at Conf.loadUid (/usr/lib/node_modules/npm/lib/config/load-uid.js:11:5)
at Conf.<anonymous> (/usr/lib/node_modules/npm/lib/config/core.js:235:10)
at Conf.setUser (/usr/lib/node_modules/npm/lib/config/set-user.js:15:34)
at Conf.loadExtras (/usr/lib/node_modules/npm/lib/config/core.js:233:8)
at Conf.<anonymous> (/usr/lib/node_modules/npm/lib/config/core.js:172:12)
at Object.onceWrapper (events.js:286:20)
/usr/lib/node_modules/npm/lib/npm.js:34
throw new Error('npm.load() required')
^
Error: npm.load() required
at Object.get (/usr/lib/node_modules/npm/lib/npm.js:34:13)
at exit (/usr/lib/node_modules/npm/lib/utils/error-handler.js:60:40)
at process.errorHandler (/usr/lib/node_modules/npm/lib/utils/error-handler.js:178:3)
at process.emit (events.js:198:13)
at process._fatalException (internal/bootstrap/node.js:496:27)
即使在尝试更新npm本身时,也是如此:
npm install -g npm@latest
我得到了错误。我正在运行nvm,所以我也测试了不同的节点版本,并且遇到相同的错误。知道我该如何解决吗?