cognitive-engineering-lab / mdbook-quiz

Interactive quizzes for Markdown
http://cel.cs.brown.edu/mdbook-quiz/
Apache License 2.0
100 stars 21 forks source link

From source installation error #14

Open azmasamy opened 1 year ago

azmasamy commented 1 year ago

I can't install the project

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

willcrichton commented 1 year ago

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?

azmasamy commented 1 year ago

bash

willcrichton commented 1 year ago

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.

azmasamy commented 1 year ago

Same error :/

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

What is the output of which pnpm?

willcrichton commented 1 year ago

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

azmasamy commented 1 year ago

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

Here is the output of which pnpm : image

willcrichton commented 1 year ago

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());
}