Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Current anchor
0.30.1
doesn't have optional package manager and is hardcoded to useyarn
. And to run a migration it simply runs:yarn run ts-node ... {migration stuff}
in the cwd.So when calling a migration from root route, due to package.json existance in anchor folder, it expected a node_modules to exist and call
ts-node
from there. But due to nx and monorepo structure, it's placed in root. Furthermore nx ignores nested package.json - so simply removing them (anchor/package.json and anchor/package-lock.json) fixes the problem.After the fix when
anchor-migrate
is run anchor will place"packageManager": "[email protected]+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
in root package.json. This is for now ignored and not committed because our current manager is npm and anchor is planning to add support in the next version.New commands:
npm run anchor-migrate-localnet
npm run anchor-migrate-devnet