繁体   English   中英

Node.js使用python安装ws错误

[英]Node.js install ws error with python

安装了python 3.5.0版本(感谢Hiren S.),因为我没有安装它。 现在,当我尝试安装ws(Web套接字)时遇到此错误。仍然不知道我遇到了什么错误或这意味着什么。

C:\Documents and Settings\Grimm>npm install python
python@0.0.4 node_modules\python

C:\Documents and Settings\Grimm>npm install ws
-
> bufferutil@1.2.1 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>

> utf-8-validate@1.2.1 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 bufferutil@1.2.1
npm WARN optional dep failed, continuing utf-8-validate@1.2.1
ws@0.8.0 node_modules\ws
├── options@0.0.6
└── ultron@1.0.2

C:\Documents and Settings\Grimm>

您没有安装Python或未设置PYTHON环境变量。

您必须从此处下载python: https : //www.python.org/downloads/

Python 2.7版可与Node js(而非3.xx版)一起使用。 尝试安装此版本:2.7.11。 然后检查Python的路径:C:\\ Python27 \\和C:\\ Python27 \\ Scripts

然后以管理员身份在命令中运行npm install --global --production Windows-build-tools

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM