node-gyp: Error: 404 status code downloading 32-bit node.lib

I recently updated to node 4.0 on Windows 10 and it seems that I am now unable to use modules that rely on node-gyp.

Specifically, my issue is that whenever I try to install a module, I get the following semi-crypitc error:

gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: 404 status code downloading 32-bit node.lib
gyp ERR! stack     at Request.<anonymous> (C:\Users\Mauve\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\install.js:377:20)
gyp ERR! stack     at emitOne (events.js:82:20)
gyp ERR! stack     at Request.emit (events.js:169:7)
gyp ERR! stack     at Request.onRequestResponse (C:\Users\Mauve\AppData\Roaming\npm\node_modules\npm\node_modules\request\request.js:1008:10)
gyp ERR! stack     at emitOne (events.js:77:13)
gyp ERR! stack     at ClientRequest.emit (events.js:169:7)
gyp ERR! stack     at HTTPParser.parserOnIncomingClient (_http_client.js:415:21)
gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:305:20)
gyp ERR! stack     at emitOne (events.js:77:13)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Mauve\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Mauve\someproject\node_modules\lwip
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Mauve\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "lwip"
npm ERR! node v4.0.0
npm ERR! npm  v2.14.3
npm ERR! code ELIFECYCLE

npm ERR! lwip@0.0.6 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lwip@0.0.6 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the lwip 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 lwip
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Mauve\someproject\npm-debug.log

It seems like it’s getting a 404 when downloading something, but I’m not sure what I can do about that.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 21 (4 by maintainers)

Most upvoted comments

OP: your output says gyp ERR! node-gyp -v v2.0.2, and anyone else in here who has an alternative npm installed including

I’m running NPM 3.3.2

You currently must use the npm that’s bundled with Node v4.0.0, both vanilla npm v2 and npm v3 ship with an older node-gyp which doesn’t know about the new node.lib locations but for Node v4 we’re shipping a patched version that has node-gyp v3 installed. npm will be shipping it soon though (@zkat says npm v2 will get it in next week’s release, I’m not sure about v3).

This is primarily a problem for Windows because of the node.lib location change. All other platforms just need the source tarball which they can get just fine but the newer node-gyp also swaps out the source tarball for a much smaller headers tarball so that’s a bonus.

If you want to try and hack your npm install because you’re somehow stuck on a particular version then you can do this (not supported or necessarily recommended):

  1. find the node_modules/npm/ directory on your system, OP has C:\Users\Mauve\AppData\Roaming\npm\node_modules\npm, cd into that directory
  2. run npm install node-gyp@latest

that should bundle the right node-gyp with the version of npm you’re using and it should work

another alternative is to install node-gyp globally and use it directly to compile addons, that’s not so convenient when they’re coming as project dependencies though.

@everettmuniz Thank you! Your solution worked for me.

I am using nodist so I did

$ cd C:\nodist\bin\node_modules\npm
$ npm install node-gyp@latest

Thanks again.

Installing Node 4.1.2 and NPM 3.3.6 and node-gyp globally only led me to the following very weird error 😕

@ C:\Projects\Github\InstitutionsWeb\node_modules\core-js\node_modules\utf-8-validate
> if not defined npm_config_node_gyp (node "C:\Program Files (x86)\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.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(366,5): warning MSB8003: Could not fi
nd WindowsSDKDir variable from the registry.  TargetFrameworkVersion or PlatformToolset may be set to an invalid versio
n number. [C:\Projects\Github\InstitutionsWeb\node_modules\core-js\node_modules\utf-8-validate\build\validation.vcxproj
]
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [C:\Projects\Github\Ins
titutionsWeb\node_modules\core-js\node_modules\utf-8-validate\build\validation.vcxproj]


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 (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\bui
ld.js:270:23)
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 (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_
modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Projects\Github\InstitutionsWeb\node_modules\core-js\node_modules\utf-8-validate
gyp ERR! node -v v4.1.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:utf-8-validate utf-8-validate@1.2.1 install: `node-gyp rebuild`
npm WARN install:utf-8-validate Exit status 1

I had the same issue yesterday. Very new to nodejs but here’s how I fixed it. YMMV.

  1. Open a command prompt as administrator
  2. Change the current directory to the directory your version of NPM is running from. For me that is “C:\Program Files\nodejs\node_modules\npm”
  3. copy the “C:\Program Files\nodejs\node_modules\npm” to something like “C:\Program Files\nodejs\node_modules\npmOld” in case you want to undo the next step
  4. typed: npm install node-gyp@latest
  5. hit enter

To the best of my knowledge, that’s updating the version of node-gyp that NPM is using.