Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module '../../../lib/util' #310

Open
rayhaanq opened this issue Nov 24, 2017 · 8 comments
Open

Error: Cannot find module '../../../lib/util' #310

rayhaanq opened this issue Nov 24, 2017 · 8 comments

Comments

@rayhaanq
Copy link

rayhaanq commented Nov 24, 2017

Hi there I'm trying to get a project up and running using trails but I can't seem to install it. I've done npm install -g yo generator-trails which works fine but when I do yo trails I get the error below. Any idea how this can be fixed?

Issue Description

Error: Cannot find module '../../../lib/util'
    at Function.Module._resolveFilename (module.js:527:15)
    at Function.Module._load (module.js:476:23)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\SomePath\AppData\Roaming\npm\node_modules\generator-trails\generators\app\steps\writing.js:5:14)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)

Environment

  • node version: 8.9.1
  • trails version: 3.0.0-pre.3
  • operating system: Windows 10
@rayhaanq
Copy link
Author

rayhaanq commented Nov 25, 2017

The problem was probably because I didn't run npm install from the generator-trails folder? I went to https://github.com/trailsjs/generator-trails and downloaded the zip of the repo, Copied over the lib folder. Fixed for me.

@rayhaanq
Copy link
Author

rayhaanq commented Nov 25, 2017

Now getting another error...

module.js:538
    throw err;
    ^

Error: Cannot find module 'trails/controller'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (E:\SomePath\trails-test\node_modules\trailpack-express\lib\utils.js:3:20)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (E:\SomePath\trails-test\node_modules\trailpack-express\lib\server.js:16:15)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @0.0.0 start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Rayhaan\AppData\Roaming\npm-cache\_logs\2017-11-25T11_27_25_359Z-debug.log

This generator is really broken. Would appreciate some fixes.

@alient
Copy link

alient commented Nov 30, 2017

I'm getting the same error Error: Cannot find module '../../../lib/util' on Node 6 and Mac.

@rayhaanq
Copy link
Author

rayhaanq commented Nov 30, 2017

@alient DId you try what I did? Btw after this I ran into other errors. I don't think trails is stable atm. Waiting for a stable release.

@alient
Copy link

alient commented Nov 30, 2017

Too much work. Defeats the purpose. Moving to the next framework. 8-)

@scott-wyatt
Copy link
Member

Hi all, trails is a bit between v3 and v2 atm which has been causing some issues with the generator in v3. If you are interested in starting fast, you'll want to stick with v2 as we get everything migrated over. The migration from v3 to v2 appears to be pretty easy, but it's got some work needed before I'd recommend it.

@pixelbacon
Copy link

Same error... And not to throw a fit, but wasn't documentation not being updated a big issue with the big S?

I understand big version changes, but if the suggested method of getting started is the generator method... the generator method should always work, and the master branch should always match up with the generator. This makes me think it's going to be another endeavor of searching through github issues or stackoverflow to see what something broke and how to fix it...

@scott-wyatt
Copy link
Member

@pixelbacon This is a good point. @trailsjs/maintainers and doc writers, when making our docs and getting started, we should probably globally install the version of the generator we are using. npm install -g yo generator-trails@2 and npm install -g yo generator-trails@3 etc. so that when trails v4 comes out, we don't have this issue again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants