2014-01-14 3 views
2

Express를 전역 적으로 설치하려고 시도하고이 오류가 발생합니다. 내 x86 qnap에 node.js 버전 0.10.24를 실행 중입니다.node.js -g와 함께 플러그인을 설치할 때 npm 오류가 발생했습니다.

[/share/Qweb/Codiad/workspace/chat] # npm install express -g 
npm ERR! Error: setuid user id does not exist 
npm ERR! at /share/MD0_DATA/.qpkg/Optware/lib/node_modules/npm/node_modules/uid-number/uid-number.js:44:16 
npm ERR! at ChildProcess.exithandler (child_process.js:635:7) 
npm ERR! at ChildProcess.EventEmitter.emit (events.js:98:17) 
npm ERR! at maybeClose (child_process.js:735:16) 
npm ERR! at Socket. (child_process.js:948:11) 
npm ERR! at Socket.EventEmitter.emit (events.js:95:17) 
npm ERR! at Pipe.close (net.js:466:12) 
npm ERR! If you need help, you may report this entire log, 
npm ERR! including the npm and node versions, at: 
npm ERR! http://github.com/isaacs/npm/issues 

npm ERR! System Linux 3.4.6 
npm ERR! command "/opt/bin/node" "/opt/bin/npm" "install" "express" "-g" 
npm ERR! cwd /share/MD0_DATA/Qweb/Codiad/workspace/chat 
npm ERR! node -v v0.10.24 
npm ERR! npm -v 1.3.21 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR! /share/MD0_DATA/Qweb/Codiad/workspace/chat/npm-debug.log 
npm ERR! not ok code 0 
+1

이 https://github.com/npm/npm/issues/3789 –

+0

같은 오류하지만 솔루션 :( – Tan

+0

예 로컬 패키지를 설치 @damphat없이 작동하는 것 같다 인텔 x86 기반 시리즈 오류가 발생했습니다 – Tan

답변

5

npm 도구는 QNAP OS

에서 제대로 작동하지 않습니다 해결 방법은 QNAP가 지원하지 않는 npm을 말하고있다 얻거나 npm 소스 코드를 수정하여 사용자 ID를 설정합니다

열기 파일의 uid-number.js

/share/MD0_DATA/.qpkg/Optware/lib/node_modules/npm/node_modules/uid-number/uid-‌​number.js

고토 line 11uidSupport = false

3

QNAP은 리눅스 시스템에서 사용 가능한 시스템 사용자의 커플 구성 노드가 포함 된 아웃 - 오브 - 박스 따라서 일부 소프트웨어가 와 QNAP에서 제대로 작동하지 않습니다 부족으로 uidSupport = process.getuid && process.setuid를 교체합니다.

문제의 해결책 : 사용자 nobody을 생성하십시오. adduser -D -H nobody 또는 NAS의 웹 UI를 사용할 수 있습니다.

행운을 빈다.

0

Node.js를 v5.8.0 download page

이 시도 : node-upgrade.sh

#!/bin/sh 

URL=$1 

[[ $URL =~ (node-v5\.8\.0-.*)\.tar\.gz$ ]] && TARFile=${BASH_REMATCH[0]} && DirName=${BASH_REMATCH[1]} 
[[ $TARFile == "" ]] && echo "url is wrong" && exit 

NodeJSPath=$(/sbin/getcfg nodejs Install_Path -f /etc/config/qpkg.conf) 

wget --no-check-certificate $URL 

tar zxf $TARFile -C $NodeJSPath 

rm -r $NodeJSPath/node $TARFile 

ln -s $NodeJSPath/$DirName $NodeJSPath/node 

uidscript=$NodeJSPath/$DirName/lib/node_modules/npm/node_modules/uid-number/uid-number.js 
script="$(cat $uidscript)" 

echo "${script/", uidSupport = process.getuid && process.setuid"/, uidSupport = false}" > $uidscript 

예를 들어, 내 QNAP NAS는

sh ./node-upgrade.sh https://nodejs.org/download/release/v5.8.0/node-v5.8.0-linux-x86.tar.gz 
관련 문제