2015-09-26 126 views
0

安裝python 3.5.0版(感謝Hiren S.)說我沒有安裝它。現在,當我嘗試安裝ws(web套接字)時,出現此錯誤。仍然不知道發生了什麼錯誤或其含義。Node.js使用python安裝ws錯誤

C:\Documents and Settings\Grimm>npm install python 
[email protected] node_modules\python 

C:\Documents and Settings\Grimm>npm install ws 
- 
> [email protected] install C:\Documents and Settings\Grimm\node_modules\ws\node_m 
odules\bufferutil 
> node-gyp rebuild 


C:\Documents and Settings\Grimm\node_modules\ws\node_modules\bufferutil>if not de 
fined npm_config_node_gyp (node "E:\Agar\Ogar-master\src\nodejs\node_modules\npm 
\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild) else 
(node rebuild) 
gyp ERR! UNCAUGHT EXCEPTION 
gyp ERR! stack Error: spawn UNKNOWN 
gyp ERR! stack  at exports._errnoException (util.js:837:11) 
gyp ERR! stack  at ChildProcess.spawn (internal/child_process.js:298:11) 
gyp ERR! stack  at exports.spawn (child_process.js:339:9) 
gyp ERR! stack  at exports.execFile (child_process.js:141:15) 
gyp ERR! stack  at checkPythonVersion (E:\Agar\Ogar-master\src\nodejs\node_mo 
dules\npm\node_modules\node-gyp\lib\configure.js:86:5) 
gyp ERR! stack  at E:\Agar\Ogar-master\src\nodejs\node_modules\npm\node_modul 
es\node-gyp\lib\configure.js:53:9 
gyp ERR! stack  at E:\Agar\Ogar-master\src\nodejs\node_modules\npm\node_modul 
es\which\which.js:82:18 
gyp ERR! stack  at FSReqWrap.oncomplete (fs.js:82:15) 
gyp ERR! System Windows_NT 5.1.2600 
gyp ERR! command "E:\\Agar\\Ogar-master\\src\\nodejs\\node.exe" "E:\\Agar\\Ogar- 
master\\src\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js 
" "rebuild" 
gyp ERR! cwd C:\Documents and Settings\Grimm\node_modules\ws\node_modules\bufferu 
til 
gyp ERR! node -v v4.1.1 
gyp ERR! node-gyp -v v3.0.3 
gyp ERR! This is a bug in `node-gyp`. 
gyp ERR! Try to update node-gyp and file an Issue if it does not help: 
gyp ERR!  <https://github.com/nodejs/node-gyp/issues> 

> [email protected] install C:\Documents and Settings\Grimm\node_modules\ws\no 
de_modules\utf-8-validate 
> node-gyp rebuild 


C:\Documents and Settings\Grimm\node_modules\ws\node_modules\utf-8-validate>if no 
t defined npm_config_node_gyp (node "E:\Agar\Ogar-master\src\nodejs\node_modules 
\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild) e 
lse (node rebuild) 
gyp ERR! UNCAUGHT EXCEPTION 
gyp ERR! stack Error: spawn UNKNOWN 
gyp ERR! stack  at exports._errnoException (util.js:837:11) 
gyp ERR! stack  at ChildProcess.spawn (internal/child_process.js:298:11) 
gyp ERR! stack  at exports.spawn (child_process.js:339:9) 
gyp ERR! stack  at exports.execFile (child_process.js:141:15) 
gyp ERR! stack  at checkPythonVersion (E:\Agar\Ogar-master\src\nodejs\node_mo 
dules\npm\node_modules\node-gyp\lib\configure.js:86:5) 
gyp ERR! stack  at E:\Agar\Ogar-master\src\nodejs\node_modules\npm\node_modul 
es\node-gyp\lib\configure.js:53:9 
gyp ERR! stack  at E:\Agar\Ogar-master\src\nodejs\node_modules\npm\node_modul 
es\which\which.js:82:18 
gyp ERR! stack  at FSReqWrap.oncomplete (fs.js:82:15) 
gyp ERR! System Windows_NT 5.1.2600 
gyp ERR! command "E:\\Agar\\Ogar-master\\src\\nodejs\\node.exe" "E:\\Agar\\Ogar- 
master\\src\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js 
" "rebuild" 
gyp ERR! cwd C:\Documents and Settings\Grimm\node_modules\ws\node_modules\utf-8-v 
alidate 
gyp ERR! node -v v4.1.1 
gyp ERR! node-gyp -v v3.0.3 
gyp ERR! This is a bug in `node-gyp`. 
gyp ERR! Try to update node-gyp and file an Issue if it does not help: 
gyp ERR!  <https://github.com/nodejs/node-gyp/issues> 
npm WARN optional dep failed, continuing [email protected] 
npm WARN optional dep failed, continuing [email protected] 
[email protected] node_modules\ws 
├── [email protected] 
└── [email protected] 

C:\Documents and Settings\Grimm> 

回答

0

您未安裝Python或PYTHON環境變量未設置。

你必須從這裏下載的Python:https://www.python.org/downloads/

+0

好吧,我安裝了Python,現在我得到了一個不同的錯誤。現在更新我的帖子。 –

0

的Python 2.7版本的作品與節點JS(未版本3.x.x)。 嘗試安裝,而不是此版本:2.7.11。 然後檢查你的Python的路徑:C:\ Python27 \和C:\ Python27 \ Scripts中

在您的命令以管理員身份

然後,NPM運行安裝--global - 生產Windows的構建工具