0

我尝试在 Node.js 中安装一个模块以与 Superfeedr 的 XMPP API 交互。正如这里所解释的(https://github.com/superfeedr/superfeedr-node),这就是我在 Node.js 中所做的:

npm install superfeedr

但我在控制台中收到以下消息:

// at the beginning it seems ok but then...

C:\Users\Gabrielle\node_modules\superfeedr\node_modules\node-xmpp\node_modules\node-xmpp-core\node_modules\node-stringprep>node 
"C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_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.0.6001
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-
gyp.js" "rebuild"
gyp ERR! cwd 

//and much following...

我错过了什么吗?为什么提到 Python(我根本不使用 Python)?

4

1 回答 1

1

我找到了解决方案的开始:我在 C:\Python27 中下载了 Python 2.7,然后通过执行以下操作在 Node.js 中设置 PYTHON 变量:

set PYTHON=C:\Python27\Python.exe

(有关详细信息,请参阅在 Windows 上运行 Python 以获取 Node.js 依赖项

然后重新启动:

npm install superfeedr

错误“gyp ERR!堆栈错误:找不到 Python 可执行文件“python”,您可以设置 PYTHON env 变量”不再发生。好的!

但是现在一条错误消息告诉您“无法加载复合 Visual C++“VCBuild.exe””。它问我:安装开发工具包 Microsoft Windows SDK for Windows Server 2008 和 .NET Framework 2.0 3.5,或安装 Visual Studio 2008。然后我收到消息问我:安装开发工具包 .NET Framework 2.0 SDK 或安装 Visual Studio 2005。我猜这是另一个问题......

(请参阅错误 MSB3411:无法加载 Visual C++ 组件“VCBuild.exe”

于 2014-04-03T21:24:16.020 回答