trailsjs / trails

:evergreen_tree: Modern Web Application Framework for Node.js.
http://trailsjs.io
Other
1.66k stars 70 forks source link

AssertionError: missing path in new trails application #36

Closed konstantinzolotarev closed 8 years ago

konstantinzolotarev commented 8 years ago
info: Starting...
debug: trails event: trails:start
verbose: Trailpacks: All Validated.
debug: trails event: trailpack:all:validated
debug: trails event: trailpack:core:configured
debug: trails event: trailpack:repl:configured
debug: trails event: trailpack:router:configured
debug: trails event: trailpack:hapi:configured
debug: trails event: trailpack:all:configured
debug: trails event: trailpack:core:initialized
debug: trails event: trailpack:repl:initialized
debug: trails event: trailpack:router:initialized
error:
 AssertionError: missing path
    at Module.require (module.js:364:3)
    at require (module.js:385:17)
    at Object.registerViews (/Volumes/Repos/Coding/OpenSource/trails/test/node_modules/trailpack-hapi/lib/server.js:28:15)
    at Hapi.initialize (/Volumes/Repos/Coding/OpenSource/trails/test/node_modules/trailpack-hapi/index.js:37:16)
    at /Volumes/Repos/Coding/OpenSource/trails/test/node_modules/trails/index.js:65:26
    at process._tickDomainCallback (node.js:422:9)
    at Function.Module.runMain (module.js:459:11)
    at startup (node.js:138:18)
    at node.js:974:3
debug: trails event: trails:stop
tjwebb commented 8 years ago

related to https://github.com/trailsjs/trailpack-hapi/issues/3. I need to publish a new version of trailpack-hapi.

But on that note, I need to come up with a strategy to democratize the publishing of certain modules. I'll work on a process for this over the weekend. Suggestions are welcome as well.

konstantinzolotarev commented 8 years ago

@tjwebb Actually I used latest version from git. Just linked it.

ronenteva commented 8 years ago

Same here. Any workaround?

tjwebb commented 8 years ago

@ronenteva I'm publishing new trails and trailpack-hapi versions tonight with these fixes. Sorry for the inconvenience.

Mark your calendars: Trails 1.0-alpha1 is being released on January 8!

jaumard commented 8 years ago

I have this error on template example app and fix it by adding a template engine in config/views.js

/**
 * Views Configuration
 * (app.config.views)
 *
 * @see http://trailsjs.io/doc/config/views.js
 */
module.exports = {
  engine: 'jade'
}

I fork the repo to fix all the errors and have an example project who is working : https://github.com/jaumard/trails-example-app

huafu commented 7 years ago

I am still having this issue, created a new app with all defaults (except I do not choose to enable footprints), then npm start and it is complaining about trails/controller not found from the trailpack-hapi package... in the api/controllers/FootprintController.js:

$ npm start

> fideli-api@0.0.0 start /.../my-app
> node server.js

module.js:472
    throw err;
    ^

Error: Cannot find module 'trails/controller'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/.../my-app/node_modules/trailpack-hapi/api/controllers/FootprintController.js:5:20)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/.../my-app/node_modules/trailpack-hapi/api/controllers/index.js:1:93)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/.../my-app/node_modules/trailpack-hapi/api/index.js:1:85)
    at Module._compile (module.js:571:32)

npm ERR! Linux 4.4.0-47-generic
npm ERR! argv "/home/huafu/.nvm/versions/node/v7.2.0/bin/node" "/home/huafu/.nvm/versions/node/v7.2.0/lib/node_modules/npm/bin/npm-cli.js" "start"
npm ERR! node v7.2.0
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! fideli-api@0.0.0 start: `node server.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the fideli-api@0.0.0 start script 'node server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the fideli-api package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs fideli-api
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls fideli-api
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /.../my-app/npm-debug.log

Process finished with exit code 1

FYI:

$ npm version
{ npm: '3.10.9',
  ares: '1.10.1-DEV',
  cldr: '30.0.2',
  http_parser: '2.7.0',
  icu: '58.1',
  modules: '51',
  node: '7.2.0',
  openssl: '1.0.2j',
  tz: '2016g',
  unicode: '9.0',
  uv: '1.10.1',
  v8: '5.4.500.43',
  zlib: '1.2.8' }

Any idea?

scott-wyatt commented 7 years ago

@huafu there is a break in the generator as we are switching to 2.0 (it's from us using the term latest in generated files), the maintainers are aware of the issue and working to get it fixed as soon as possible.

joost commented 7 years ago

Is there a workaround for the issue mentioned by @huafu ? Except for disabling Footprints?

jaumard commented 7 years ago

Yes use only v1 or v2 version of trails modules not a mix of v2/v1

joost commented 7 years ago

I get this error when starting a brand new trails app:

 yo trails

Get ready to blaze a new Trails Application!

Choose a Web Server express
What express version do you want to use ? 4
Choose an ORM waterline
Do you want to use Footprints (automatic REST API from models) ? No

Next .. when I do npm start I get the following error:

> someproject@0.0.0 start /Users/joost/someproject
> node server.js

module.js:339
    throw err;
    ^

Error: Cannot find module 'trails/controller'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/Users/joost/someproject/node_modules/trailpack-express/lib/utils.js:3:20)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/Users/joost/someproject/node_modules/trailpack-express/lib/server.js:16:15)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)

npm ERR! Darwin 16.1.0
npm ERR! argv "/Users/joost/.nvm/versions/node/v4.2.1/bin/node" "/Users/joost/.nvm/versions/node/v4.2.1/bin/npm" "start"
npm ERR! node v4.2.1
npm ERR! npm  v4.0.3
npm ERR! code ELIFECYCLE
npm ERR! someproject@0.0.0 start: `node server.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the someproject@0.0.0 start script 'node server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the someproject package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs someproject
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls someproject
npm ERR! There is likely additional logging output above.
jaumard commented 7 years ago

I know, there some issues with the generator because it set some modules at v1 and some at v2. Just change this on package.json to have only v1 or v2 and it will work normally

joost commented 7 years ago

@jaumard thanks. Can you give an example for both v1 and v2? I tried but can't seem to find packages for v2:

    "trails-controller": "^1.0.0",
    "trails-model": "^1.0.0",
    "trails-policy": "^1.0.2",
    "trails-service": "1.0.0",
konstantinzolotarev commented 7 years ago

We already have this issue described here: https://github.com/trailsjs/trailpack-express/issues/52

joost commented 7 years ago

Thanks. The solution in https://github.com/trailsjs/trailpack-express/issues/52 worked. So: change "trailpack-express": "^2.0.0-rc1" to "trailpack-express": "^1.1.0".