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

Installing from master #11

Open
davej opened this issue May 16, 2015 · 2 comments
Open

Installing from master #11

davej opened this issue May 16, 2015 · 2 comments

Comments

@davej
Copy link

davej commented May 16, 2015

You're probably aware of this and will fix it for the next release but I'll create an issue just in case.

EG doesn't seem to run correctly after installing from master (wanted to try out the new require: .module syntax).

npm install -g breuleux/earl-grey && earl

Install succeeds but running the earl command gives the following error:

Error: Cannot find module '../lib6/run'
    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/dave/.nvm/versions/io.js/v2.0.1/lib/node_modules/earlgrey/bin/earl:4:5)
    at Module._compile (module.js:431:26)
    at Object.Module._extensions..js (module.js:449:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:472:10)
@breuleux
Copy link
Owner

Right. The up-to-date JavaScript for the compiler is not under version control. Only an older version is stored in bootstrap. To produce the library you need to run bin/bootstrap 2. That command will compile the current code in src with bootstrap into temp_bootstrap_0, then with temp_bootstrap_0 to produce temp_bootstrap_1, then finally with temp_bootstrap_1 to produce lib6 (basically, it goes old:old => old:new => new:new => new:new, the last step is needed to make sure the new compiler doesn't mess up when it compiles itself). It takes one or two minutes to run.

I could put something like if [ ! -d 'lib6' ]; then bin/bootstrap 2; fi as an install hook, but I have no idea what that does if someone runs Windows.

Does it work if you clone the repo and run npm install -g? I'm reading npm install runs the prepublish hooks when you run it locally.

@davej
Copy link
Author

davej commented May 16, 2015

That makes sense. Yeah, an install hook would be useful, probably best to make it a node script for compatibility, it only needs to be a few lines anyway.

var buildDirStats = fs.statSync('lib6')
if (!buildDirStats.isDirectory()) {
  // build EG
}

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

2 participants