Kyle Krzeski
Kyle Krzeski

Reputation: 6527

Angular 6 Update - rxjs-5-to-6-migrate command not found

In the upgrade process from update.angular.io:

Remove deprecated RxJS 6 features using rxjs-tslint auto update rules.

For most applications this will mean running the following two commands:

npm install -g rxjs-tslint
rxjs-5-to-6-migrate -p src/tsconfig.app.json

But when I follow these steps and run rxjs-5-to-6-migrate -p src/tsconfig.app.json I'm getting the error:

rxjs-5-to-6-migrate: command not found

Is there any reason why this command isn't working?

Upvotes: 25

Views: 20926

Answers (5)

Benyakoub Mohammed
Benyakoub Mohammed

Reputation: 1

Having this issues when executing the command

npx rxjs-tslint -p src/tsconfig.app.json

Running the automatic migrations. Please, be patient and wait until the execution completes.

Invalid option for project: src/tsconfig.app.json Error while running the migration: ,,Invalid option for project: src/tsconfig.app.json

Upvotes: 0

Phuc
Phuc

Reputation: 743

Here is my command:

npx rxjs-tslint -p app/tsconfig.app.json

Upvotes: 1

frosty
frosty

Reputation: 21762

When I got this, I had to follow the following steps. They took me a while to figure out, so I figure I should share them here:

  1. run npm install rxjs-tslint
  2. run cd node_modules/rxjs-tslint
  3. run npm install
  4. cd back out of your node_modules directory, back to your project home
  5. run rxjs-5-to-6-migrate -p ./tsconfig.json

On step #5 you make need to change the path to point to your tsconfig.json file. But that is where mine was. It finally worked!

Hope it works for you like it worked for me.

Upvotes: 11

jsdream
jsdream

Reputation: 1253

I did get it working and my steps are the following:

  1. Install rxjs-tslint locally - cd YOUR_PROJECT_DIR && npm i rxjs-tslint.
  2. Then run from your project root node_modules/.bin/rxjs-5-to-6-migrate -p PATH_TO_YOUR_TSCONFIG.json.
  3. If you get an error saying something like rxjs-tslint/node_modules/.bin/tslint: not found, then do cd node_modules/rxjs-tslint && npm install and repeat the step 2.

Upvotes: 55

Anth0
Anth0

Reputation: 3052

Follow the instruction to install the dependency globally then try using the full path to the file rxjs-5-to-6-migrate.

For example: /usr/local/lib/node_modules/rxjs-tslint/bin/rxjs-5-to-6-migrate -p src/tsconfig.app.json

If you don't know where the dependencies are stored on your computer you can run npm root -g

Upvotes: 3

Related Questions