I’m stuck in a very strange error that completely prevents me from building a rescript react application.
Why or how this error happens is a mystery to me, but to reproduce:
- Clone a basic template repo I use for starting a new rescript project: https://github.com/Zeta611/rs-template
-
yarn install
,yarn build:deps
, andyarn start
will successfully build a project. - Adding a new react library via
yarn add react-confetti
andyarn install
will prevent me from doingyarn build:deps
; it results in the following error:
❯ yarn build
yarn run v1.22.19
$ rescript
/bin/sh: rescript: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
What’s more irritating is that neither yarn remove
nor deleting the project directory and re-cloning solves this issue.
I also tried reinstalling npm
and yarn
via Homebrew, along with removing the cache directories like ~/.yarn
.
I could reproduce it on two of my Macs, and I simply cannot restore my machines to the state where the projects were building properly.
So my questions are
- How can I restore my machines so that my projects start building again?
- What have I done wrong?
Thank you.