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

stylus instructions in CONTRIBUTING.md are not fool proof #292

Closed
budziq opened this issue May 20, 2017 · 3 comments
Closed

stylus instructions in CONTRIBUTING.md are not fool proof #292

budziq opened this issue May 20, 2017 · 3 comments
Labels
A-Infrastructure Area: CI, Releases C-bug Category: A bug, incorrect or unintended behavior

Comments

@budziq
Copy link
Contributor

budziq commented May 20, 2017

Hi, I was trying to correct https://github.com/azerupi/mdBook/pull/289

While the stylus itself and required changes seam pretty straightforward, the real problem was for actually making cargo build --features=regenerate-css work without crashing.

suggested npm install in mdbook dir results in:

$ npm install
npm WARN enoent ENOENT: no such file or directory, open '/home/budziq/work/rust/mdBook/package.json'
npm WARN mdBook No description
npm WARN mdBook No repository field.
npm WARN mdBook No README data
npm WARN mdBook No license field.

cargo build --features=regenerate-css results in relatively cryptic

$ cargo build --features=regenerate-css
   Compiling mdbook v0.0.22-pre (file:///home/budziq/work/rust/mdBook)
error: failed to run custom build command for `mdbook v0.0.22-pre (file:///home/budziq/work/rust/mdBook)`
process didn't exit successfully: `/home/budziq/work/rust/mdBook/target/debug/build/mdbook-fa6b8542367f4aa5/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 2, message: "No such file or directory" } }', /checkout/src/libcore/result.rs:859
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Installing stylus by hand with npm install stylus -g graduates us to:

cargo build --features=regenerate-css
   Compiling mdbook v0.0.22-pre (file:///home/budziq/work/rust/mdBook)
error: failed to run custom build command for `mdbook v0.0.22-pre (file:///home/budziq/work/rust/mdBook)`
process didn't exit successfully: `/home/budziq/work/rust/mdBook/target/debug/build/mdbook-fa6b8542367f4aa5/build-script-build` (exit code: 101)
--- stderr
module.js:472
    throw err;
    ^

Error: Cannot find module 'nib'
    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 /usr/lib/node_modules/stylus/bin/stylus:795:10
    at Array.forEach (native)
    at usePlugins (/usr/lib/node_modules/stylus/bin/stylus:792:11)
    at /usr/lib/node_modules/stylus/bin/stylus:653:9
    at tryToString (fs.js:449:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:436:12)
thread 'main' panicked at 'Stylus encoutered an error', build.rs:26
note: Run with `RUST_BACKTRACE=1` for a backtrace.

And only installing nib did the trick for me npm install nib -g.

@azerupi I guess that some config file is missing (I am not sure as I have zero experience with node/npm but you have suggested contact if CONTRIBUTING.md is not clear in any way). While the CONTRIBUTING.md is written clearly imho it is not foolproof for someone without webdev experience.

@azerupi
Copy link
Contributor

azerupi commented May 20, 2017

Oh right, this is my fault. 😞
I didn't go through the procedure again while writing the guide and I made a mistake.
You are right, stylus and nib need to be installed with (sudo) npm install -g stylus nib.

@azerupi
Copy link
Contributor

azerupi commented May 20, 2017

I pushed a fix to the contribution guide, hopefully it is correct this time 😉
Thank you for letting me now.

@azerupi azerupi added A-Infrastructure Area: CI, Releases C-bug Category: A bug, incorrect or unintended behavior labels May 21, 2017
@azerupi
Copy link
Contributor

azerupi commented May 22, 2017

This issue can be closed now, thanks @budziq

@azerupi azerupi closed this as completed May 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Infrastructure Area: CI, Releases C-bug Category: A bug, incorrect or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants