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

How to run? #113

Open
phoenix-oes opened this issue Nov 27, 2023 · 4 comments
Open

How to run? #113

phoenix-oes opened this issue Nov 27, 2023 · 4 comments

Comments

@phoenix-oes
Copy link

npm run migrate -- -d <my path>

This only results in

npm ERR! Missing script: "migrate"
npm ERR! 
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

Moving to its globally installed location and trying to run from there results in:

> [email protected] migrate
> ts-node src/index.ts -d <the path I specified>

sh: 1: ts-node: not found

Installing ts-node and trying again...

> [email protected] migrate
> ts-node src/index.ts -d <my path again>

node:internal/modules/cjs/loader:1078
  throw err;
  ^

Error: Cannot find module './index.ts'
Require stack:
- /home/<me>/.nvm/versions/node/v18.14.2/lib/node_modules/vue-class-migrator/src/imaginaryUncacheableRequireResolveScript
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    at Function.resolve (node:internal/modules/cjs/helpers:116:19)
    at requireResolveNonCached (/home/<me>/.nvm/versions/node/v18.14.2/lib/node_modules/vue-class-migrator/node_modules/ts-node/dist/bin.js:549:16)
    at getProjectSearchDir (/home/<me>/.nvm/versions/node/v18.14.2/lib/node_modules/vue-class-migrator/node_modules/ts-node/dist/bin.js:519:40)
    at phase3 (/home/<me>/.nvm/versions/node/v18.14.2/lib/node_modules/vue-class-migrator/node_modules/ts-node/dist/bin.js:267:27)
    at bootstrap (/home/<me>/.nvm/versions/node/v18.14.2/lib/node_modules/vue-class-migrator/node_modules/ts-node/dist/bin.js:47:30)
    at main (/home/<me>/.nvm/versions/node/v18.14.2/lib/node_modules/vue-class-migrator/node_modules/ts-node/dist/bin.js:33:12)
    at Object.<anonymous> (/home/<me>/.nvm/versions/node/v18.14.2/lib/node_modules/vue-class-migrator/node_modules/ts-node/dist/bin.js:579:5)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/<me>/.nvm/versions/node/v18.14.2/lib/node_modules/vue-class-migrator/src/imaginaryUncacheableRequireResolveScript'
  ]
}

Node.js v18.14.2

I'm pointing it to the folder where the .vue files that need to be updated are located.

@Asuza
Copy link

Asuza commented Dec 7, 2023

This is what worked for me, using Yarn.

yarn dlx vue-class-migrator -- -d .\src\

@suits-at
Copy link

suits-at commented Jan 3, 2024

I had the same problem, what worked for me was:

  1. installing it into the project where I wanted to make the migration (instead of globally)
  2. creating a migrate script inside my package.json (looks like this: "migrate": "vue-class-migrator -d ./src/pages/")
  3. calling this script via npm run migrate

@s4v4g3
Copy link

s4v4g3 commented Jan 5, 2024

after installing it globally you can run
npx vue-class-migrator ...

@dcecile
Copy link

dcecile commented Feb 23, 2024

after installing it globally you can run npx vue-class-migrator ...

Specifically, the -- is invalid, so this needs to be npx vue-class-migrator -d <my path>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants