发布于 4年前

Error: setuid user id does not exist

Error: setuid user id does not exist

[root@TNAS waque2yuque]# npm i -g waque
Error: setuid user id does not exist
at /mnt/md0/application/nodejs/lib/node_modules/npm/node_modules/uid-number/uid-number.js:49:16
at ChildProcess.exithandler (child_process.js:285:7)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:962:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
TypeError: Cannot read property 'get' of undefined
at errorHandler (/mnt/md0/application/nodejs/lib/node_modules/npm/lib/utils/error-handler.js:205:18)
at /mnt/md0/application/nodejs/lib/node_modules/npm/bin/npm-cli.js:78:20
at cb (/mnt/md0/application/nodejs/lib/node_modules/npm/lib/npm.js:228:22)
at /mnt/md0/application/nodejs/lib/node_modules/npm/lib/npm.js:266:24
at /mnt/md0/application/nodejs/lib/node_modules/npm/lib/config/core.js:83:7
at Array.forEach (<anonymous>)
at /mnt/md0/application/nodejs/lib/node_modules/npm/lib/config/core.js:82:13
at f (/mnt/md0/application/nodejs/lib/node_modules/npm/node_modules/once/once.js:25:25)
at afterExtras (/mnt/md0/application/nodejs/lib/node_modules/npm/lib/config/core.js:173:20)
at Conf.<anonymous> (/mnt/md0/application/nodejs/lib/node_modules/npm/lib/config/core.js:231:22)
/mnt/md0/application/nodejs/lib/node_modules/npm/lib/utils/error-handler.js:205
if (npm.config.get('json')) {
^

TypeError: Cannot read property 'get' of undefined
at process.errorHandler (/mnt/md0/application/nodejs/lib/node_modules/npm/lib/utils/error-handler.js:205:18)
at process.emit (events.js:182:13)
at process._fatalException (internal/bootstrap/node.js:493:27)
[root@TNAS-LAN waque2yuque]# npm i -g waque
Error: setuid user id does not exist
at /mnt/md0/application/nodejs/lib/node_modules/npm/node_modules/uid-number/uid-number.js:49:16
at ChildProcess.exithandler (child_process.js:285:7)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:962:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
TypeError: Cannot read property 'get' of undefined
at errorHandler (/mnt/md0/application/nodejs/lib/node_modules/npm/lib/utils/error-handler.js:205:18)
at /mnt/md0/application/nodejs/lib/node_modules/npm/bin/npm-cli.js:78:20
at cb (/mnt/md0/application/nodejs/lib/node_modules/npm/lib/npm.js:228:22)
at /mnt/md0/application/nodejs/lib/node_modules/npm/lib/npm.js:266:24
at /mnt/md0/application/nodejs/lib/node_modules/npm/lib/config/core.js:83:7
at Array.forEach (<anonymous>)
at /mnt/md0/application/nodejs/lib/node_modules/npm/lib/config/core.js:82:13
at f (/mnt/md0/application/nodejs/lib/node_modules/npm/node_modules/once/once.js:25:25)
at afterExtras (/mnt/md0/application/nodejs/lib/node_modules/npm/lib/config/core.js:173:20)
at Conf.<anonymous> (/mnt/md0/application/nodejs/lib/node_modules/npm/lib/config/core.js:231:22)
/mnt/md0/application/nodejs/lib/node_modules/npm/lib/utils/error-handler.js:205
if (npm.config.get('json')) {
^

TypeError: Cannot read property 'get' of undefined
at process.errorHandler (/mnt/md0/application/nodejs/lib/node_modules/npm/lib/utils/error-handler.js:205:18)
at process.emit (events.js:182:13)
at process._fatalException (internal/bootstrap/node.js:493:27)

解决

在编辑器中打开文件:

/usr/local/lib/node_modules/npm/node_modules/uid-number/uid-number.js

在第11行 uidSupport = process.getuid && process.setuid 替换为 uidSupport = false

npm
©2020 edoou.com   京ICP备16001874号-3