node.js - 如何为nodejs安装win32ole(即使node-gyp正常工作)

标签 node.js installation windows-7-x64 win32ole

抱歉,我是nodejs新手。我想在Windows7下尝试使用nodejs中的包win32ole,但是当我在以管理员身份打开的命令提示符窗口中运行安装命令npm install win32ole时,会弹出许多错误向上。

我的配置是:

  • Windows 7 64 位(版本 6.1.7601)
  • 适用于 Windows 桌面的 Microsoft Visual Studio Express 2015 - ENU(恕我直言,必须安装 20GB 的软件才能尝试使 Node-gyp 正常工作,就像某种 IT 模型的失败证明)
  • 微软.NET Framework 4.6
  • 安装了 Python 2.7.9 和 3.4.3,但我将 python 命令指向 2.7.9
  • nodejs 版本 4.2.1
  • npm 版本 2.14.7
  • Node gyp 3.0.3
  • PYTHON 环境变量设置为 C:\Python27\python.exe
  • 使用命令 node-gyp --python C:\Python27\ 告诉 node-gyp 在哪里可以找到 Python
  • 告诉npm在哪里可以使用命令npm config set python C:\Python27\python.exe找到Python

这是控制台输出:

C:\Windows\system32
>npm install win32ole
Impossibile trovare il percorso specificato.
npm WARN engine <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="45322c2b76772a292005756b746b76" rel="noreferrer noopener nofollow">[email protected]</a>: wanted: {"node":">= 0.8.18 && < 0.9.0"} (current: {"node":"4.2.1","npm":"2.14.7"})
\
> <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="83f1e6e5c3b2adb1adb3" rel="noreferrer noopener nofollow">[email protected]</a> install C:\Windows\system32\node_modules\win32ole\node_modules\ref
> node-gyp rebuild


C:\Windows\system32\node_modules\win32ole\node_modules\ref
>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node  rebuild )
Impossibile trovare il percorso specificato.
gyp: Call to 'node -e "require('nan')"' returned exit status 1. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:355:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Windows\system32\node_modules\win32ole\node_modules\ref
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "win32ole"
npm ERR! node v4.2.1
npm ERR! npm  v2.14.7
npm ERR! code ELIFECYCLE

npm ERR! <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5f2d3a391f6e716d716f" rel="noreferrer noopener nofollow">[email protected]</a> install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2b594e4d6b1a0519051b" rel="noreferrer noopener nofollow">[email protected]</a> install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the ref package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls ref
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Windows\system32\npm-debug.log

有关于我做错了什么的线索吗?

跟进

我想我没有做错什么,Windows下的包node-gyp,正如评论中指出的,有一些问题:https://github.com/nodejs/node-gyp/issues/629

最佳答案

使用最新的 Node.js 版本是不可能的。

使用node winax

关于node.js - 如何为nodejs安装win32ole(即使node-gyp正常工作),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33146316/

相关文章:

javascript - Node.js路由错误: script MIME types are not allowed when 'X-Content-Type: nosniff' is given

installation - GAC 程序集而不将其嵌入 MSI 中

ubuntu - 在 Ubuntu 上安装 ROS

c++17 - 升级到 Visual Studio 2019 和 v142 工具集后,为什么我的程序不再在 Windows 7 上运行?

phantomjs - 无法将屏幕截图保存到 casperjs 中的某个位置(windows7 64 位)

javascript - 如何在node.js中记录请求对象的所有属性?

javascript - 如何判断 POST 请求是否包含要在 Sails.js 中上传的文件?

node.js - 如何在 Node 上使用pouchdb-authentication?

python - 使其他非 root 用户可以访问以 root 身份安装的 python 库

powershell - 无法在 Core i7 上运行 Powershell 64