envone / ember-runner

EmberJS preview and build tool for Node.JS
MIT License
50 stars 6 forks source link

uglify-js #34

Closed SamuelTilly closed 12 years ago

SamuelTilly commented 12 years ago

I followed the guide but got stuck at: node.js:201 throw e; // process.nextTick error, or 'error' event on first tick ^ Error: Cannot find module 'uglify-js' at Function._resolveFilename (module.js:332:11) at Function._load (module.js:279:25) at Module.require (module.js:354:17) at require (module.js:370:17) at Object. (/usr/lib/node_modules/ember-runner/lib/handlers.js:4:16) at Module._compile (module.js:441:26) at Object..js (module.js:459:10) at Module.load (module.js:348:32) at Function._load (module.js:308:12) at Module.require (module.js:354:17)

I tried to install uglify-js with npm but same error occures annyway. what gives?

SamuelTilly commented 12 years ago

ok i got past that issue with npm install -g uglify-js got the same problem for "commander" so i did a npm install -g commander

now im stuck at: /usr/lib/node_modules/ember-runner/index.js:169 if (devBuildInfo.vendors.distributions) { ^ TypeError: Cannot read property 'distributions' of undefined at /usr/lib/node_modules/ember-runner/index.js:169:31 at [object Object]. (fs.js:115:5) at [object Object].emit (events.js:64:17) at afterRead (fs.js:1117:12) at Object.wrapper as oncomplete

envone commented 12 years ago

Hi, @eldamar seems that I have an old npm build because we don't use uglify-js anymore, instead now we use the yiu-compressor, because uglify-js wasn't friendly for ember.js. I have made many changes in the repo including the pre-compilation of templates, give me some time to check if I can upload a new version.

SamuelTilly commented 12 years ago

Hi again, i started over and tried everything again from scratch but now i get stuck at this: TypeError: Cannot read property 'distributions' of undefined at /usr/lib/node_modules/ember-runner/index.js:185:31 at fs.readFile (fs.js:176:14) at Object.oncomplete (fs.js:297:15)

When i try to run ember-runner preview.

File structure is this: root

I really need to get into js development for a large project (without rails) and i like the way you have everything setup here. I've heard so much great stuff about emberjs but i can't seem to get going. The most crucial thing for me is to have a good and clean file structure but none of the official documentation covers this. Without it i would be developing something that i could never manage after just a couple of weeks. Sorry for ranting here but i really hope i can make sense of all this.

envone commented 12 years ago

Hi @eldamar let's try to run this beast! Can you please show the ember_runner_config.json file? So can check if all is ok?

SamuelTilly commented 12 years ago

Thanks! the ember_runner_config.json is empty, only contains {}

paynerc commented 12 years ago

The TypeError: Cannot read property error is fixed in the Pull Request that I have pending.

SamuelTilly commented 12 years ago

I populated the ember_runner_config.json file and it seems to have solved the problem. i get this warning tho:

[build] Started [Build] Package: ember-metal [Build] Package: ember-runtime [Build] Package: ember-views [Build] Package: ember-states [Build] Package: metamorph [Build] Package: ember-handlebars WARNING: ember-handlebars is required in ember-handlebars/helpers/collection but does not exists. WARNING: ember-handlebars is required in ember-handlebars/helpers/view but does not exists.

ember_runner_config.json:

{

"apps": { "input": "apps", "styles": "css", "static": "static", "templates": "templates", "scripts": "js", "output": "public/apps" },

"vendors": { "input": "vendors", "distributions": { "ember": ["ember.js/packages/ember-metal", "ember.js/packages/ember-runtime", "ember.js/packages/ember-views", "ember.js/packages/ember-states", "ember.js/packages/metamorph", "ember.js/packages/ember-handlebars"] }, "styles": "css", "static": "static", "templates": "templates", "scripts": "lib", "output": "public/libraries" },

"server": { "static": "public", "port": "3000", "proxy": { "useProxy": false, "host": "localhost", "port": 3101, "prefix": "^\/backend" } }

}

envone commented 12 years ago

The warning is an indication that some file requires a file that don't exists. this is useful to detect if somefile are missing to add in the path (main.js) or because requires something that are not loaded too. Or because isn't used.

I will check this pull request asap, thanks for you observations.