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

Deadly 提交于 2019-12-21 07:26:18

问题


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?


回答1:


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.



回答2:


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




回答3:


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-tslist
  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.



来源:https://stackoverflow.com/questions/50330546/angular-6-update-rxjs-5-to-6-migrate-command-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!