如何为Node.js安装Win32ole(即使Node-Gyp正常工作) [英] How to install win32ole for nodejs (i.e. making node-gyp work properly)

查看:411
本文介绍了如何为Node.js安装Win32ole(即使Node-Gyp正常工作)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,我是nodejs的新手.我想在Windows7下的nodejs中尝试软件包win32ole,但是当我在以管理员身份打开的命令提示符窗口中运行安装命令npm install win32ole时,会弹出许多错误.

Sorry, I'm a newbie of nodejs. I'd like to try the package win32ole in nodejs under Windows7, but when I run the installation command npm install win32ole in a command prompt window opened as administrator, many errors pop up.

我的配置是:

  • Windows 7 64位(版本6.1.7601)
  • 用于Windows桌面的Microsoft Visual Studio Express 2015-ENU(必须安装20GB的软件才能尝试使节点gyp正常工作,这就像是针对某些IT模型的失败证明)
  • Microsoft .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在哪里可以找到命令node-gyp --python C:\Python27\
  • 的Python
  • 告诉npm在哪里可以找到命令npm config set python C:\Python27\python.exe
  • 的Python
  • Windows 7 64 bit (version 6.1.7601)
  • Microsoft Visual Studio Express 2015 for Windows Desktop - ENU (imho having to install 20GB of software to try to make node-gyp work is like a certification of failure for a certain IT model)
  • Microsoft .NET Framework 4.6
  • both Python 2.7.9 and 3.4.3 installed, but I made python command point to 2.7.9
  • nodejs version 4.2.1
  • npm version 2.14.7
  • node-gyp 3.0.3
  • PYTHON environment variable set to C:\Python27\python.exe
  • told to node-gyp where to find Python with command node-gyp --python C:\Python27\
  • told to npm where to find Python with command npm config set python C:\Python27\python.exe

这是控制台输出:

C:\Windows\system32
>npm install win32ole
Impossibile trovare il percorso specificato.
npm WARN engine win32ole@0.1.3: wanted: {"node":">= 0.8.18 && < 0.9.0"} (current: {"node":"4.2.1","npm":"2.14.7"})
\
> ref@1.2.0 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! ref@1.2.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ref@1.2.0 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

关于我在做什么错的任何线索吗?

Any clue on what I'm doing wrong?

跟进

我想我没有做错什么,正如评论中指出的那样,Windows下的软件包node-gyp有一些问题:

I guess there is nothing I'm doing wrong, the package node-gyp under Windows, as pointed out in a comment, has some issues: https://github.com/nodejs/node-gyp/issues/629

推荐答案

最新的node.js版本是不可能的.

It's not possible with up to date node.js versions.

使用节点winax

这篇关于如何为Node.js安装Win32ole(即使Node-Gyp正常工作)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆