【问题标题】:Cannot install node-steam for node.js无法为 node.js 安装 node-steam
【发布时间】:2014-09-17 03:24:08
【问题描述】:

我尝试从 ... 安装 node-steam,但出现大错误
我该如何解决这个问题,这是我的错吗?
节点蒸汽:https://github.com/seishun/node-steam

...
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\nod
e_modules\node-gyp\lib\configure.js:101:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:64:11
gyp ERR! stack     at Object.oncomplete (fs.js:107:15)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "configure" "build"
gyp ERR! cwd C:\Users\FongZooZ\Desktop\project\test\node_modules\steam\node_modu
les\ursa
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
...

请帮帮我!

【问题讨论】:

  • 阅读错误消息failNoPython 会有所帮助。看来你需要安装python...

标签: javascript node.js npm steam


【解决方案1】:
  • 转到 Google 并为您的系统找到 Python 2.6。 (https://www.python.org/download/releases/2.6/)
  • 下载并安装 python 二进制文件。
  • 假设您使用的是 Windows,因为您没有告诉我们您的操作系统,它默认安装在 C:\python26\python.exe 中。
  • 现在打开一个空的CMD 执行set PYTHON=C:\python26\python.exe,然后运行npm install node-steam,它应该可以工作了。

注意:如果不将 PYTHON 添加到 PATH 变量中,则应在每次需要 Python 的安装之前键入 set PYTHON=C:\python26\python.exe

您也可以在他们的官方网站上找到 Linux 二进制文件。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-06-21
  • 2018-03-29
  • 2017-03-06
  • 1970-01-01
相关资源
最近更新 更多