mwaylabs / Espresso

The-M-Projects build tools using node.js.
www.the-m-project.org
Other
84 stars 28 forks source link

espresso running using node on Windows 7 #42

Closed maxnis closed 12 years ago

maxnis commented 12 years ago

Finally i installed cygwin and node - which can run hello example, but when i run command in the cygwin shell: node espresso.js i get the following :

$ node espresso.js

node.js:63 throw e; ^ Error: Cannot find module 'step' at loadModule (node.js:275:15) at require (node.js:411:14) at Object. (/cygdrive/c/themproject/espresso/core/e.js:64:25) at Module._compile (node.js:462:23) at Module._loadScriptSync (node.js:469:10) at Module.loadSync (node.js:338:12) at loadModule (node.js:283:14) at require (node.js:411:14) at Object. (/cygdrive/c/themproject/espresso/core/commands/versio n.js:12:9) at Module._compile (node.js:462:23)

4z3 commented 12 years ago

It seems like you haven't initialized the submodules; try

(cd /cygdrive/c/themproject/espresso && git submodule update --init)
maxnis commented 12 years ago

I'm pretty sure I ran the update command the first time, nonetheless i ran it again, and get the same error. what am i doing wrong? how to start epresso? node espresso.js?

maxnis commented 12 years ago

ok, i figured it out myself, not sure if it's versions mismatch, a node bug - must have step.js file or espresso must load it correctly: the e.js line 64 tries to load node step.js file: E.prototype.sequencer = require('step'); - which was not in the node lib folder so i changed the path to the espresso step.js file E.prototype.sequencer = require('../node_modules/step/lib/step'); and it started working. Node version: 0.2.6 Espresso version: 0.7.2

The same problem is in files: /espresso/generator/file_generator.js and project_generator.js There is the same problem with all node modules: mu, step, wwwdude. So i couldn't run the server, project was half generated, but after copying the entire framework folder from a sample project - build ran successfully and generated build folder, which works, been deployed to the web server (IIS in this case).

4z3 commented 12 years ago

Thank you for the extensive bug-report; I just reconstructed the problem with the said Node version and it happens to affect all the Espresso versions.

Unfortunately it also seems that there where no plans to support Node 0.2 in the first place and I'm not sure if there are any plans to support it any time soon, if at all.

If you cannot upgrade to Node 0.4 or higher, you could try to set the environmental variable NODE_PATH to the appropriate colon-separated list of directories. On POSIX-like systems one could call Espresso directly with the augmented environment like this:

NODE_PATH="/path/to/your/Espresso/node_modules/step/lib" espresso version