Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

feature request: Accept yarn instead of npm #1679

Closed
ggreif opened this issue May 22, 2021 · 0 comments
Closed

feature request: Accept yarn instead of npm #1679

ggreif opened this issue May 22, 2021 · 0 comments
Labels
needs-triage This ticket needs investigation.

Comments

@ggreif
Copy link
Contributor

ggreif commented May 22, 2021

Currently npm is hard-coded in dfx:

$ git grep '"npm"'
src/dfx/src/commands/new.rs:    std::process::Command::new("npm")
src/dfx/src/commands/new.rs:    std::process::Command::new("npm")
src/dfx/src/lib/builders/assets.rs:        let mut cmd = std::process::Command::new("npm");

I am asking for support for the (more-or-less) drop-in replacement yarn. I had some nice success using it in connection with vuetify:

  • git clone https://github.com/nop33/dfinity-vue -b vuetify
  • dfx start --background --clean
  • yarn add webpack-cli
  • env NPM=yarn dfx deploy (suggested way of using yarn instead of npm)
  • open http://localhost:8000/?canisterId=ryjl3-tyaaa-aaaaa-aaaba-cai

The assets.rs invocation works out of the box (this is what the above commands trigger). The new.rs would need some adaptation (maybe probing).

An alternative would be to introduce a --toolchain argument (in-lieu-of NPM env-var): dfx --toolchain=yarn would just select the yarn incarnation of the commands and could potentially also do the yarn add webpack-cli step.

I am happy to send a PR if you think this is a good idea.

@ggreif ggreif changed the title Accept yarn instead of npm feature request: Accept yarn instead of npm May 22, 2021
@p-shahi p-shahi added enhancement needs-triage This ticket needs investigation. labels Jun 6, 2021
@dfinity dfinity locked and limited conversation to collaborators Oct 4, 2022
@sesi200 sesi200 converted this issue into discussion #2629 Oct 4, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
needs-triage This ticket needs investigation.
Projects
None yet
Development

No branches or pull requests

2 participants