How to install win32ole for nodejs (i.e. making node-gyp work properly)
Asked Answered
W

2

2

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.

My configuration is:

  • 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

Here's the console output:

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

FOLLOW UP

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

Windtight answered 15/10, 2015 at 10:39 Comment(0)
O
3

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

Use node winax

Old answered 6/9, 2019 at 15:51 Comment(0)
B
1

First of all you have a warning due to the node version

npm WARN engine [email protected]: wanted: {"node":">= 0.8.18 && < 0.9.0"} (current: {"node":"4.2.1","npm":"2.14.7"})

It should be lower than 0.9.0

Have you installed node-gyp? I'm seeing a lot of error complaining it. If not you can install it with this command

npm install -g node-gyp
Bandoleer answered 15/10, 2015 at 12:44 Comment(4)
I manually installed node-gyp in advance of win32ole installation, but errors persist. See my updated question.Windtight
Have you tried with an old version of node, just to see if is the new version causing the problem? I'm saying this because the author imposed an upper limit explicitly.Bandoleer
After that, I realize that trying to make node-gyp work is just a loss of time. Thanks anyway.Windtight
Depends i've never had problem with it but i've many windows sdk installed and all .Net runtimesBandoleer

© 2022 - 2024 — McMap. All rights reserved.