I am trying to build d3.js under Windows. I have installed cygwin to run the makefile. However, as part of make install, it calls ‘npm install’, and this call fails:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'C:\cygdrive\c\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js'
at Function._resolveFilename (module.js:332:11)
at Function._load (module.js:279:25)
at Array.0 (module.js:479:10)
at EventEmitter._tickCallback (node.js:192:40)
Makefile:230: recipe for target `install' failed
make: *** [install] Error 1
The problems seems to be that the cygwin path prefix (‘cygdrive\c’) is added to the file path (other than that, the path is correct).
I am wondering if there is a good workaround for this problem? I have tried to export the NODE_PATH variable as well as changing it in the Makefile. However, this does not affect this error (and I would prefer to keep the Makefile as it is).
EDIT: It worked when I called ‘npm install’ from the Webstorm command line (without cygwin). I had to install contextify (jsdom requirement) manually (‘npm install contextify -f’ and then copy the .node file from https://github.com/Benvie/contextify/downloads into build/Release for contextify), and to run ‘npm install jsdom’ and ‘npm install vows’ afterwards.
You can edit the
npmscript so that it is cygwin-aware: