Node.js cannot find module - cygwin interference on Windows

I am testing the Bootstrap framework (from Twitter) and trying to create it locally after installing Node.js. It fails because it cannot find a smaller module (which I also installed with "npm install -g less"):

C:\Users\geir\code\bootstrap>make lessc html/less/bootstrap.less > html/css/bootstrap.css node.js:201 throw e; // process.nextTick error, or 'error' event on first tick ^ Error: Cannot find module 'C:\cygdrive\c\Users\geir\AppData\Roaming\npm\node_modules\less\bin\lessc' 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:2: recipe for target `all' failed make: *** [all] Error 1 

The reason it fails is because "cygdrive \" is added to the folder hierarchy, when make is looking for a module, I checked that thtat "lessc" is really found in C: \ Users \ geir \ AppData \ Roaming \ npm \ node_modules \ less \ bin \ lessc, and I can run it from the command line.

I tried the following without any success:

  • Replacing the folders in the PATH env variable so that Node.js and npm come before cygwin is the same result.
  • Remove cygwin from PATH - the make command stops working.
  • set 'less' with the / -g' (npm) option
  • Reinstall Node.js

Any clues?

+5
npm less twitter-bootstrap cygwin
source share
1 answer

Call a call from the Cygwin terminal. Open Cygwin Terminal, then cd to the cygwin alias for the folder C: \ Users \ geir \ code \ bootstrap, then run make:

 geir@WINHOSTNAME ~ $cd /cygdrive/c/Users/geir/code/bootstrap geir@WINHOSTNAME /cygdrive/c/Users/geir/code/bootstrap $make 
+1
source share

All Articles