首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何为nodejs安装win32ole (即使nodejs正常工作)

如何为nodejs安装win32ole (即使nodejs正常工作)
EN

Stack Overflow用户
提问于 2015-10-15 10:39:25
回答 2查看 2.8K关注 0票数 2

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

我的配置是:

  • Windows 7 64位(版本6.1.7601)
  • 2015 for Windows Desktop - ENU (imho必须安装20 IT的软件才能使节点-gyp工作,就像对某个IT模型失败的认证)
  • 微软.NET框架4.6
  • 安装了Python2.7.9和3.4.3,但我使python命令指向2.7.9
  • nodejs版本4.2.1
  • npm版本2.14.7
  • 节点-GIP3.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

以下是控制台输出:

代码语言:javascript
复制
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

知道我做错了什么吗?

跟踪

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

EN

回答 2

Stack Overflow用户

发布于 2019-09-06 15:51:50

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

使用节点winax

票数 2
EN

Stack Overflow用户

发布于 2015-10-15 12:44:39

首先,由于节点版本,您有一个警告

代码语言:javascript
复制
npm WARN engine win32ole@0.1.3: wanted: {"node":">= 0.8.18 && < 0.9.0"} (current: {"node":"4.2.1","npm":"2.14.7"})

应低于0.9.0

您安装了节点-gyp吗?我看到很多错误都在抱怨。如果没有,可以使用以下命令安装它

代码语言:javascript
复制
npm install -g node-gyp
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33146316

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档