tower-archive / tower

UNMAINTAINED - Small components for building apps, manipulating data, and automating a distributed infrastructure.
http://tower.github.io
MIT License
1.79k stars 120 forks source link

[error] - Cannot find //app/config/shared/application #328

Closed stevenrace closed 12 years ago

stevenrace commented 12 years ago

So I brazenly decided to 'npm update' and now I get the following message when running 'node server' or 'cake watch'.

This also happens when creating a new project under Linux.

$> cake watch
Loading "grunt.coffee" tasks and helpers...
ERROR
>> Error: Cannot find module '//app/config/shared/application'
<WARN> Task "start" not found. Use --force to continue. <WARN>

Aborted due to warnings.
$> node server
module.js:340
    throw err;
          ^
Error: Cannot find module '//app/config/shared/application'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Function.Tower.Application.Application.reopenClass.instance ($myprojectpathhere/node_modules/tower/lib/tower-application/server/application.js:40:15)
    at CommandServer.run ($myprojectpathhere/node_modules/tower/lib/tower-command/server/server.js:37:30)
    at _.extend.run ($myprojectpathhere/node_modules/tower/lib/tower/server.js:120:44)
    at Object.<anonymous> ($myprojectpathhere/server.js:2:18)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
thehydroimpulse commented 12 years ago

I'm guessing this a path issue. Line #34 shows it's using static path separators instead of _path.sep, but because your on a unix platform the separators should be correct.

Tower.root could be the culprit as we had issues with it in the past. I had updated that section to work on windows and mac osx but maybe ubuntu was failing on it.

I'll fire up my vm of ubuntu and see if I can't replicate the problem.

lancejpollard commented 12 years ago

Hmm... okay, this I think may be because of this:

packages/tower/server.coffee#L93

What is the value of Tower.root?

Also, did you update the global and local versions of tower?

npm install tower -g
npm install tower # in project

Last thing, that Tower.setRoot function first checks process.env.TOWER_ROOT, which is now set in server.js. See if setting that helps:

tower-generator/server/generators/tower/app/templates/server.js

lancejpollard commented 12 years ago

Nice @TheHydroImpulse, forgot about that line, that's where it is!

lancejpollard commented 12 years ago

Also @stevenrace what is the value of $myprojectpathhere? The reason is if the project is created at the top-level, such as /my-app (and so having /my-app/node_modules, etc.), it may cause issues in the way the root is calculated (when it's missing). If not then it should be fine.

stevenrace commented 12 years ago

@viatropos, I just used that to censor my user and project name. It's something like /home/myname/towerjs_project/...

Ran npm update && npm install tower -g && npm install tower - didn't seem to change.

Thanks for the prompt help. I'm in IRC (adriftatsea) if it's easier to discuss there...

edubkendo commented 12 years ago

This turned out to be a case of the original project had been generated with a version of tower that pre-dated the change in folder structure. When he ran npm update, his version of tower was updated, and so tower was looking for the files in the wrong places.

stevenrace commented 12 years ago

Exactly (although it required npm update -g && npm install tower -g and creating a new project and merging existing content over. No biggie.).

Thanks guys for the help.