mdbook-quiz icon indicating copy to clipboard operation
mdbook-quiz copied to clipboard

From source installation error

Open azmasamy opened this issue 1 year ago • 8 comments

I can't install the project

Here is a screenshot of the cargo and pnpm versions and the installation error: image

azmasamy avatar Nov 29 '22 13:11 azmasamy

Weird... I would assume that Command::new("pnpm") would use the PATH of the process, which is inherited from Cargo.

What shell are you running? Is this bash in WSL?

willcrichton avatar Nov 29 '22 18:11 willcrichton

bash

azmasamy avatar Nov 29 '22 18:11 azmasamy

Can you try running this in a standalone script and see if it works? i.e. make a file test.rs with these contents:

use std::process::Command;

fn main(){
  let result = Command::new("pnpm").arg("-v").output().unwrap();
  println!("{}", String::from_utf8(result.stdout).unwrap());
}

Then run rustc test.rs && ./test and see if you get an error.

willcrichton avatar Nov 29 '22 19:11 willcrichton

Same error :/

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: NotFound, message: "program not found" }', test.rs:4:56

azmasamy avatar Nov 29 '22 19:11 azmasamy

What is the output of which pnpm?

willcrichton avatar Nov 29 '22 20:11 willcrichton

(Sorry for all the questions, I don't have a Windows machine, and I'm not sure how to solve this.)

willcrichton avatar Nov 29 '22 20:11 willcrichton

No worries, It's my job to provide enough info as an issue creator.

Here is the output of which pnpm : image

azmasamy avatar Nov 30 '22 06:11 azmasamy

Try running this script instead?

use std::process::Command;

fn main(){
  let result = Command::new("cmd").args(&["/C", "pnpm", "-v"]).output().unwrap();
  println!("{}", String::from_utf8(result.stdout).unwrap());
}

willcrichton avatar Dec 05 '22 22:12 willcrichton