kristianmandrup / ember-config

Yeoman generator for ember-cli to facilitate configuring an Ember app with various asset compilers, components, layout frameworks etc.
9 stars 1 forks source link

Error: Cannot find module '../../lib/aid' #1

Open jarrodldavis opened 10 years ago

jarrodldavis commented 10 years ago

I run yo ember-config from the root of the freshly generated Ember CLI app and this error occurs:

Error: Cannot find module '../../lib/aid'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/generator-ember-config/generators/app/index.js:6:14)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
jarrodldavis commented 10 years ago

Hmm, it seems like this is fixed as of bbd72c5332418967cf78b7579c6efc33dd8883df. The current release (v0.1.11 / ff87261) on NPM is what has this issue.

kristianmandrup commented 10 years ago

Thanks @jarrodldavis, I will fix it right away, do some tests and make a new stable release. Cheers! PS: Let me know how it works for you ;)

kristianmandrup commented 10 years ago

I just tested most of the generators and I discovered a ton of bugs. Been developing and pushing a little too quickly and without testing sufficiently. Optimally I should be maintaining a test suite at the same time, but is all about time... Just pushed a new release that should be way more stable. But if you find any bigs, please fork the project, fix em and make a pull request. Thanks ;)

reblevins commented 10 years ago

Hi, thanks for making this tool. Has this fix been updated on npm yet? I just installed using npm today and I'm still getting this error.

kristianmandrup commented 10 years ago

Hmm, strange! I will look into it ASAP. Been working on libraries lately which will greatly simplify ember-config.

https://github.com/kristianmandrup/libraries

kristianmandrup commented 10 years ago

Should be fixed with 0.1.16

reblevins commented 10 years ago

Great, thanks! I look forward to trying this out.

peter-mouland commented 9 years ago

hey - was interested in trying the sails generator. do you know when you'll update npm with this fix? I'm using 0.1.16 but still have this error

kristianmandrup commented 9 years ago

Hey guys, I'm not using Ember any more these days. You are welcome to take over this project, refactor it and make whatever fixes need fixing... >L0

peter-mouland commented 9 years ago

what is the node module it needs? not sure what 'aid' is...

kristianmandrup commented 9 years ago

https://github.com/kristianmandrup/ember-config/blob/master/lib/aid.js

kristianmandrup commented 9 years ago

I will go through all the generators today and fix any bugs, with special care for sails ;)

kristianmandrup commented 9 years ago

It now runs, but an error here:

error: Error in "ember-app" generator (loaded from sails-generate-new-ember)

/Users/kristianmandrup/npm/lib/node_modules/sails/node_modules/sails-generate/lib/index.js:51
      throw e;
            ^
Error: Cannot find module 'fs-extra'
kristianmandrup commented 9 years ago

Try latest 0.1.17 release 8>)

lancedikson commented 9 years ago

I have the same issue:

Error: Cannot find module '../../lib/aid'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/generator-ember-config/generators/app/index.js:6:14)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
kristianmandrup commented 9 years ago

Fork, fix and forget... ;)

kristianmandrup commented 9 years ago

Tried to fix this, but unable to run any npm command at this point, such as npm link or npm install:

gyp ERR! cwd /Users/kristianmandrup/npm/lib/node_modules/fibers
gyp ERR! node -v v1.6.4
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok 
Build failed
npm ERR! Darwin 14.3.0
npm ERR! argv "/usr/local/bin/iojs" "/usr/local/bin/npm" "install" "-g" "fibers"
npm ERR! node v1.6.4
npm ERR! npm  v2.7.5
npm ERR! Failed at the fibers@1.0.5 install script 'node ./build.js'

Couldn't find any solution in hyperspace so far but loads of ppl have had the same issue...

Upgraded to iojs 1.6.4 and latest nvm etc. but still no luck. Also tried flexing all dependencies of ember-config in package.json ... Any ideas? Haven't worked with nodejs in a while :P

  "dependencies": {
    "sync": "x",
    "chalk": "x",
    "fs-extra": "x",
    "glob": "x",
    "string": "x",
    "sugar": "x",
    "bower-directory": "x",
    "string-mutator": "x",
    "yeoman-generator": "x",
    "yosay": "x",
    "yo": ">=1.0.0"
  },
  "devDependencies": {
    "mocha": "*"
  }

Can't install ember-config globally either due to same problem.

PS: You are welcome to take over this project if it is of interest to you.

kristianmandrup commented 9 years ago

This project needs a loving hand. The lib/aid file needs to be split up in smaller logical modules etc. Please help out ;)

lancedikson commented 9 years ago

I'll try to checkout project. First I would like to take a look at the goal of this project, but can't to run it. Will try to fix the problem and contribute if it will be helpful for me or community :)

kristianmandrup commented 9 years ago

Problem turns out to be in a very unsuspected, innocent looking place: Had a similar problem with my recent aurelia generator...

https://github.com/kristianmandrup/generator-aurelia-ts/issues/11#issuecomment-130212445

It turned out it was due to a package.json setting files: which points to generators as the place with all the files. However since /lib is outside the /generators folder (so as not to be picked up as a generator), it was inaccessible since not part of files when installed by npm! Doh :O. Tested and works now, both via npm link and global install. Finally :)