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

If yarn is not installed, npm create @metamask/snap my-first-snap causes Error: Init Error: Failed to install dependencies. #1477

Closed
vorburger opened this issue Jun 4, 2023 · 1 comment · Fixed by MetaMask/metamask-docs#778

Comments

@vorburger
Copy link

For ChainSafe/filsnap#258 :

https://docs.metamask.io/snaps/get-started/quickstart/

as well as https://docs.metamask.io/snaps/get-started/install-snaps/

mention npm or yarn. I'm in a noob in this space, and initially had only NPM but not Yarn installed on my system,

and when I first did as the documentation instructs one to, it didn't work:

$ npm create @metamask/snap my-first-snap
Need to install the following packages:
  @metamask/[email protected]
Ok to proceed? (y) y
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: This project has moved to @types/webextension-polyfill
npm WARN deprecated [email protected]: This project has moved to @types/webextension-polyfill
Preparing /home/vorburger/git/github.com/vorburger/LearningMetaMaskSnap/my-first-snap...
Cloning template...
Installing dependencies...
/bin/sh: line 1: yarn: command not found
/home/vorburger/.npm/_npx/93b2e831f912ce78/node_modules/@metamask/create-snap/dist/cmds/init/initUtils.js:118
        throw new Error('Init Error: Failed to install dependencies.');
              ^

Error: Init Error: Failed to install dependencies.
    at yarnInstall (/home/vorburger/.npm/_npx/93b2e831f912ce78/node_modules/@metamask/create-snap/dist/cmds/init/initUtils.js:118:15)
    at initHandler (/home/vorburger/.npm/_npx/93b2e831f912ce78/node_modules/@metamask/create-snap/dist/cmds/init/initHandler.js:50:33)
    at async Object.init [as handler] (/home/vorburger/.npm/_npx/93b2e831f912ce78/node_modules/@metamask/create-snap/dist/cmds/init/index.js:27:5)

Node.js v18.16.0
npm ERR! code 1
npm ERR! path /home/vorburger/git/github.com/vorburger/LearningMetaMaskSnap
npm ERR! command failed
npm ERR! command sh -c create-snap my-first-snap

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vorburger/.npm/_logs/2023-06-04T21_43_23_531Z-debug-0.log

I'm new to this space, but ... if one needs Yarn anyway, and it doesn't "just work" having only NPM, then...

... what's the point documenting both? Wouldn't it be simpler and less confusing to only mention Yarn directly?

vorburger added a commit to vorburger/metamask-docs that referenced this issue Jun 4, 2023
Because it requires Yarn anyway?!

Fixes MetaMask/snaps#1477
@martinrhan
Copy link

I installed yarn the same error is still occuring

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

Successfully merging a pull request may close this issue.

2 participants