I’m having trouble installing the dnode package on my Windows 7 machine running Node.js version 0.8.1. I’ve tested with both Python 2.7.3 and Python 3.x but keep getting the same error.
The installation starts fine but fails when trying to build the weak dependency. Here’s what I’m seeing:
C:\MyProject\App>npm install dnode
npm http GET https://registry.npmjs.org/dnode-protocol
npm http GET https://registry.npmjs.org/weak
npm http GET https://registry.npmjs.org/jsonify
npm http 408 https://registry.npmjs.org/weak
npm ERR! registry error parsing json
npm http GET https://registry.npmjs.org/weak
npm http 304 https://registry.npmjs.org/weak
npm http 304 https://registry.npmjs.org/jsonify
npm http 304 https://registry.npmjs.org/dnode-protocol
[email protected] install C:\MyProject\App\node_modules\dnode\node_modules\weak
node-gyp rebuild
gyp http GET http://nodejs.org/dist/v0.8.1/node-v0.8.1.tar.gz
gyp http 200 http://nodejs.org/dist/v0.8.1/node-v0.8.1.tar.gz
gyp ERR! Completion callback never invoked!
gyp ERR! This is a bug in node-gyp
gyp ERR! not ok
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! cmd "/c" "node-gyp rebuild" failed with 6
npm ERR! Failed at the [email protected] install script.
The error suggests it’s a node-gyp issue but I’m not sure how to fix it. Has anyone encountered this before?
Yeah, this is a classic Windows issue with the weak module. Node-gyp craps out during native compilation, especially with older Node versions on Windows. I’ve hit this same problem working with legacy setups. Just install dnode with --ignore-scripts to skip the weak dependency compilation: npm install dnode --ignore-scripts. It’ll install fine without building the native modules. The weak module handles garbage collection callbacks, but dnode works without it - just slightly different memory management. If you really need weak functionality, grab a precompiled binary or upgrade to a newer Node version that plays nicer with Windows compilation.
try switching to node 0.6.x or go for 0.10+. node 0.8.1 has issues on windows with native modules, especially weak. if you dont need gc callbacks, just use an older dnode version that skips the weak dependency.
Had the same problem with older Node on Windows. This happens because node-gyp can’t handle the compilation environment on Windows 7, especially with Node 0.8.1 being so old - the toolchain compatibility gets messy.
Here’s what fixed it for me: install Windows SDK 7.1 and make sure Visual Studio 2010 Express is set up right. Also try setting Python path manually with npm config set python C:\Python27\python.exe. Clear your npm cache first with npm cache clean - that 408 error you’re getting is usually registry-related.
You could also install an older node-gyp version that plays nice with your Node setup. That completion callback error means the build’s hanging, which screams toolchain version mismatch.