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

Anchor migrate and ts-node #2287

Closed
m00dy opened this issue Nov 26, 2022 · 4 comments
Closed

Anchor migrate and ts-node #2287

m00dy opened this issue Nov 26, 2022 · 4 comments
Labels
bug Something isn't working cli good first issue Good for newcomers

Comments

@m00dy
Copy link

m00dy commented Nov 26, 2022

installing anchor should put ts-node in execution path. Otherwise, anchor migrate fails without explicit errors. Then, you have to check out the source code and take a look at what migrate function does. It is just time consuming.

% anchor migrate --provider.cluster http://127.0.0.1:8899
Running migration deploy script
Error: No such file or directory (os error 2)

@Henry-E
Copy link

Henry-E commented Dec 7, 2022

So essentially someone needs to add a script like

"scripts": {
  "postinstall": "npm install ts-node && export PATH=$PATH:/path/to/ts-node"
}

to make sure that ts-node is on the path
or
have better error checking where if the ts-node call fails in the CLI command, it falls back and gives a better error message.

Migrate is a new feature that I'm not familiar with but it should probably just have better error checking. It's also the only command in the CLI I can see that uses ts-node (and seemingly the only place in almost the whole repo?). ts-node is only listed as a dev dependency and not a true dependency for the anchor ts package so that could also be part of the issue?

Anyone, just writing out some notes here in case anyone wants to come along and test + fix the issue. (Or future me)

@Henry-E Henry-E added the good first issue Good for newcomers label Dec 7, 2022
@ameya-deshmukh
Copy link

@Henry-E still open for contributions? :)

@Henry-E
Copy link

Henry-E commented Mar 1, 2023

sure, so long as whatever changes are made are super limited to whatever's happening in the migrate command and the externalities are minimized, namely that it doesn't somehow mess up the config for people who aren't using the command.

@acheroncrypto acheroncrypto added bug Something isn't working cli labels Jan 13, 2024
@acheroncrypto
Copy link
Collaborator

Fixed in #2767

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants