I'm trying to init a smart contract using swanky and i get this error below. I even tried changing my node version to 18.10.0. It doesn't fix it. Am I missing anything?

enter image description here

  • after switching node version, try deleting node_modules directory and yarn.lock file, and rerun the yarn command. (and also try npm install, maybe the error is more clear)
    – codespool
    Oct 25, 2023 at 14:02

1 Answer 1


I have been able to fix the issue. The problem came from the nvm installed. apparently, when you have nvm installed you can only install yarn using npm or else the node versions won't be installed on the same path and there won't be consistency. Since the default node version is controlled by nvm, installing yarn using curl or other ways except npm will cause errors, hence the error "no such file or directory: install".

To fix this issue: remove yarn by doing the following

  1. which yarn which should output \usr\bin\yarn or the location yarn is installed.
  2. remove yarn by running rm -rf \usr\bin\yarn. make sure to replace to the actual location on your pc.
  3. now install yarn using npm. npm install -g yarn.

N.b this works for linux PCs

I hope this helps someone out there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.