question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when running rxjs-5-to-6-migrate

See original GitHub issue

Installed rxjs-tslint globally, attempting to upgrade my Angular application from version 5 to 6.

I’m using the command

rxjs-5-to-6-migrate -p src/tsconfig.app.json

But it results in this error

Running the automatic migrations. Please, be patient and wait until the execution completes.
child_process.js:644
    throw err;
    ^

Error: Command failed: /usr/lib/node_modules/rxjs-tslint/node_modules/.bin/tslint -c /usr/lib/node_modules/rxjs-tslint/rxjs-5-to-6-migrate.json -p src/tsconfig.app.json --fix
    at checkExecSyncError (child_process.js:601:13)
    at Object.execSync (child_process.js:641:13)
    at migrate (/usr/lib/node_modules/rxjs-tslint/rxjs-5-to-6-migrate.js:18:34)
    at Object.<anonymous> (/usr/lib/node_modules/rxjs-tslint/rxjs-5-to-6-migrate.js:25:14)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)

There are no spaces in the path to any of the files. I have tried specifying the full path to tsconfig.app.json, same result.

Linux Kubuntu 18.04 Node 8.11.1 NPM 6.0.0 Installed packages:

/usr/lib
├── @angular/cli@6.0.0
├── npm@6.0.0
├── rxjs-tslint@0.1.3
├── tslint@5.10.0
└── typescript@2.7.2

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:21
  • Comments:31

github_iconTop GitHub Comments

77reactions
alexedencommented, May 25, 2018

If you run an npm install from inside the rxjs-tslint package’s directory, it’ll make sure it has tslint available. No need to be gross and install something globally.

  1. cd node_modules/rxjs-tslint
  2. npm install
  3. cd ../..
  4. ./node_modules/.bin/rxjs-5-to-6-migrate -p src/tsconfig.app.json

For bonus points, use npx to access the binary (I found out recently it ships with npm): npx rxjs-5-to-6-migrate -p src/tsconfig.app.json

50reactions
grumpy-programmercommented, Jun 14, 2018

In Angular Update Guide | 5.2 -> 6.0 for Advanced Apps checklist step Choose a value of off for preserveWhitespaces in your tsconfig.json to gain the benefits of this setting while the default is still to preserve whitespace. causes the problem.

Running rxjs-5-to-6-migrate -p ./src/tsconfig.app.json (no matter global or local installed) an error occurred:

./node_modules/.bin/rxjs-5-to-6-migrate -p ./src/tsconfig.app.json
Running the automatic migrations. Please, be patient and wait until the execution completes.
child_process.js:644
    throw err;
    ^

Error: Command failed: "project_path/node_modules/rxjs-tslint/node_modules/.bin/tslint" -c "project_path/node_modules/rxjs-tslint/rxjs-5-to-6-migrate.json" -p "./src/tsconfig.app.json" --fix
    at checkExecSyncError (child_process.js:601:13)
    at Object.execSync (child_process.js:641:13)
    at migrate (project_path/node_modules/rxjs-tslint/rxjs-5-to-6-migrate.js:18:34)
    at Object.<anonymous> (project_path/node_modules/rxjs-tslint/rxjs-5-to-6-migrate.js:25:14)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)

executing project_path/node_modules/rxjs-tslint/node_modules/.bin/tslint -c "project_path/node_modules/rxjs-tslint/rxjs-5-to-6-migrate.json" -p "./src/tsconfig.app.json" --fix we get: tsconfig.json(10,5): error TS5023: Unknown compiler option 'preserveWhitespaces'.

so removing preserveWhitespaces solved the problem for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 6 Update - rxjs-5-to-6-migrate command not found
run npm install rxjs-tslint · run cd node_modules/rxjs-tslint · run npm install · cd back out of your node_modules directory, back to your...
Read more >
Angular 5 to 6 Upgrade Migration with Error Fixes
Switch HtpModule and Http to HttpClientModule and HttpClient · Make sure you're using Node 8 or later · Run the commands · ng...
Read more >
Using "rxjs-5-to-6-migrate -p src/tsconfig.app.json" - Reddit
Using "rxjs-5-to-6-migrate -p src/tsconfig.app.json". UPDATE Nevermind, install with NPM makes this work. Does anyone know why the below may ...
Read more >
Error when running rxjs-5-to-6-migrate - Bountysource
Error when running rxjs -5-to-6-migrate ... Installed rxjs-tslint globally, attempting to upgrade my Angular application from version 5 to 6. I'm ...
Read more >
Guide to update your Angular application v6.0 -> v12.0 for ...
You can't run ng update to update Angular applications more than one major version at a time. ... rxjs-5-to-6-migrate -p src/tsconfig.app.json.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found