Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue Installing on Windows #166

Open
michaelraypace opened this issue Sep 16, 2016 · 9 comments
Open

Issue Installing on Windows #166

michaelraypace opened this issue Sep 16, 2016 · 9 comments

Comments

@michaelraypace
Copy link

Over the past two day's I've had issues installing on multiple platforms. Here are the errors I"m seeing on Windows:

{lamb} 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 )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  xmlparse.c
  xmltok.c
  xmlrole.c
  win_delay_load_hook.c
..\..\..\deps\libexpat\lib\xmlparse.c(1844): warning C4244: 'return': conversion from '__int64' to 'XML_Index', possib le loss of data [c:\<redacted>\node_modules\node-expat\build\deps\libexpat\expat.vcxproj]
C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c(34): error C2373: '__pfnDliNo tifyHook2': redefinition; different type modifiers [c:\<redacted>\node_modules\node-expat\build\deps\libexpat\expat. vcxproj]
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\delayimp.h(134): note: see declaration of '__pfnDliNo
  tifyHook2'
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215: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:\<redacted>\node_modules\node-expat
gyp ERR! node -v v6.5.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm WARN [email protected] No repository field.
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" "i" "-S" "xml-object-stream"
npm ERR! node v6.5.0
npm ERR! npm  v3.10.3
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! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-expat 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 information on how to open an issue for this project with:
npm ERR!     npm bugs node-expat
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-expat
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     c:\<redacted>\npm-debug.log
@mitulchauhan1
Copy link

I have faced this same issue but it get solved by following this steps by modifying package.json
http://stackoverflow.com/questions/38149603/npm-install-fails-with-error-c2373-with-vs2015-update-3

@astro
Copy link
Collaborator

astro commented Oct 11, 2016

We don't have node-gyp in our package.json.

If you have a working fix please submit a PR. I don't have access to a Windows machine for testing.

@rflpsz
Copy link

rflpsz commented Jan 11, 2017

All the links with how to use this at Windows are broken. Are there some work link? Pls

@0shape
Copy link

0shape commented Jan 15, 2017

this help`s in most cases
npm install --global --production windows-build-tools

@PostImpatica
Copy link

@oshape wow, that actually worked on Windows Server 2012, lol. I just knew it wouldn't, but I was wrong! This is regarding xml2json package that depends on this anyway. I had to have an admin prompt for both installing the build tools, then installing the local package xml2json as well.

@froglander
Copy link

froglander commented May 1, 2018

For the person who said the link someone posted was broken, I think this link works
https://stackoverflow.com/questions/38149603/npm-install-fails-with-error-c2373-with-vs2015-update-3

@UncleGus
Copy link

I have solved this. If you notice this part of the command else (node "" rebuild ) what I think is happening is that it is incorrectly evaluating if not defined npm_config_node_gyp as false and trying to run nothing instead of node-gyp. What you need to do is define your npm_config_node_gyp variable. You can do this like so:
export npm_config_node_gyp=<PATH_TO_NODE_GYP_PACKAGE_FOLDER> remember that Windows will need double backslashes. For me, it looked like this:
export npm_config_node_gyp=C:\\Users\\781990\\AppData\\Roaming\\nvm\\v6.11.0\\node_modules\\node-gyp

@ashjas
Copy link

ashjas commented Apr 19, 2019

this help`s in most cases
npm install --global --production windows-build-tools

This works wonderfully. Though it took >30 mins to install..

@ogrotten
Copy link

ogrotten commented Dec 30, 2020

@UncleGus export isn't recognized in windows powershell. Were you on mac/linux?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

10 participants