node-expat: Install error with npm on Windows 7 x64

When I try to install node-expat on my machine, I keep getting a WindowsSDKDir error. I do have the Windows 7 SDK installed, as well as Python (Python variable is set and working since it previously gave me Python problems lol). I’m not sure what the problem is. It could be a node-gyp issue, but it only happens when I install node-expat. I can install (or re-install, perhaps) node-gyp without any issue.

Going by what I can understand from the output log, it seems to be that it can’t find the WindowsSDKDir variable in the registry. However, I can find it in RegEdit. I’ve even tried changing the variable to the Windows 7 SDK directory (C:\Program Files\Microsoft SDKs\v7.1\ or something) instead of what it originally was (C:\Program Files (x86)\Microsoft SDKs\v7.0A). Could the problem be that I have VS2012 not VS2010 installed?

Thanks in advance for any help!

Log appended:

C:\Program Files (x86)\nodejs>npm install node-expat
npm http GET https://registry.npmjs.org/node-expat
npm http 304 https://registry.npmjs.org/node-expat

> node-expat@2.0.0 install C:\Program Files (x86)\nodejs\node_modules\node-expat

> node-gyp rebuild


C:\Program Files (x86)\nodejs\node_modules\node-expat>node "C:\Program Files (x8
6)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\nod
e-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(29
7,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.
  TargetFrameworkVersion or PlatformToolset may be set to an invalid version nu
mber. [C:\Program Files (x86)\nodejs\node_modules\node-expat\build\deps\libexpa
t\expat.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp
.Win32.targets(147,5): error MSB6006: "CL.exe" exited with code -1073741515. [C
:\Program Files (x86)\nodejs\node_modules\node-expat\build\deps\libexpat\expat.
vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files (x86)\nodejs\node_mo
dules\npm\node_modules\node-gyp\lib\build.js:236:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack     at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\nod
e_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Program Files (x86)\nodejs\node_modules\node-expat
gyp ERR! node -v v0.8.15
gyp ERR! node-gyp -v v0.7.1
gyp ERR! not ok
npm ERR! node-expat@2.0.0 install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the node-expat@2.0.0 install script.
npm ERR! 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 their info via:
npm ERR!     npm owner ls node-expat
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-expat"
npm ERR! cwd C:\Program Files (x86)\nodejs
npm ERR! node -v v0.8.15
npm ERR! npm -v 1.1.66
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Program Files (x86)\nodejs\npm-debug.log
npm ERR! not ok code 0

About this issue

  • Original URL
  • State: closed
  • Created 12 years ago
  • Comments: 18 (1 by maintainers)

Most upvoted comments

@lorddefinitia Not sure what you are referring to… NPM will either install packages to the global location, with -g, or into the current directory… if you have a problem with packages al over the place, odds are you’re doing it wrong.

It seems you want tools you don’t need to learn… perhaps you should stick to play dough, instead of computers.

That is a terrible solution im007boy.

Node needs to pony up and start making sense, pip is a far better experience compared with node…which seems to like leaving packages lying all around the system, with no excuse for organization.

I don’t want to learn Node and NPM package management. Screw Node. I just wanted some tools.

virtualbox + ubuntu is the best solution