Precompile error on hatchbox with yarn 2
After upgrading to yarn 2, I get the following error when deploying to hatchbox:
-----> Precompiling assets...
Unknown Syntax Error: Unsupported option name ("--no-progress").
$ yarn install [--json] [--immutable] [--immutable-cache] [--check-cache] [--inline-builds] [--skip-builds]
Compiling...
Compilation failed:
Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)
$ yarn run [--inspect] [--inspect-brk] ...
How can I fix this?
I solved this by adding a yarn install
to the deploy script on hatchbox:
-----> Precompiling assets...'
# Force webpack output so we can debug errors
if [ -w config/webpacker.yml ]; then sed -i '/webpack_compile_output/ s/false/true/g' config/webpacker.yml; fi
yarn install
rbenv exec bundle exec rake assets:precompile
fi