ts-migrate icon indicating copy to clipboard operation
ts-migrate copied to clipboard

Cannot find module 'chalk'

Open kevinfarrugia opened this issue 3 years ago • 0 comments

When running ts-migrate on the root of a project, using:

npx -p ts-migrate -c "ts-migrate-full ./"

I receive the error:

[Step 1 of 4] Initializing ts-config for the "./"...

internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module 'chalk'
Require stack:
- /my-project/node_modules/updatable-log/index.js
- /my-project/node_modules/ts-migrate/build/cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/my-project/node_modules/updatable-log/index.js:2:15)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/my-project/node_modules/updatable-log/index.js',
    '/my-project/node_modules/ts-migrate/build/cli.js'
  ]
}

After installing chalk manually, using npm install chalk I get a similar error for escape-string-regexp, ansi-styles, color-convert...etc.

When prompted, I selected the option to use the default path for the typescript compiler.

Thank you

kevinfarrugia avatar Aug 30 '21 10:08 kevinfarrugia