ReactiveX / rxjs-tslint

TSLint rules targeting RxJS
MIT License
309 stars 41 forks source link

rxjs-5-to-6-migrate - cannot find any possible migration #49

Closed josephjelaskar closed 6 years ago

josephjelaskar commented 6 years ago

rxjs-5-to-6-migrate -p src/tsconfig.json throws me below exception

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

Error: Cannot find module 'typescript' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object. (C:\Users\josephjs.NCS\AppData\Roaming\npm\node_modules\rxjs-tslint\node_modules\tslint\lib\linter.js:22:10) 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) child_process.js:644

iArnoldo commented 6 years ago

I have the same exact error .Anyone got a solution?

jmlopez-rod commented 6 years ago

Is this the directory for the app you are trying to migrate or just the global installation?

C:\Users\josephjs.NCS\AppData\Roaming\npm

I encountered the same error as you because I blindly installed it globally.

npm i -g rxjs-tslint

instead I had to do

yarn add rxjs-tslint

But after that it still didn't work because of my path. So I ran

./node_modules/.bin/rxjs-5-to-6-migrate -p tsconfig.json
josephjelaskar commented 6 years ago

@jmlopez-rod Firstly, thanks for your response .

Initially i tried with my Application level installation and ran into error.Then tried with the global installation as you have figured out. Currently i have uninstall the global installation and proceed with the app level and experience the below as i faced during the initial time

PS E:\Projects\Sources\WebAdmin.UI.Branch\node_modules.bin> .\rxjs-5-to-6-migrate -p E:\Projects\Sources\Web\Retread.WebAdmin.UI. Branch\ClientApp\tsconfig.json

The 'rxjs-no-static-observable-methods' rule threw an error in 'E:\Projects\Sources\WebAdmin.UI.Branch/ClientApp/app/services/master-admin.service.ts': TypeError: ts.isNamedImports is not a function at E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\rxjsNoStaticObservableMethodsRule.js:111:16 at Array.reduce () at findImportedRxjsOperators (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\rxjsNoStaticObservableMethodsRule.js:100:78) at Rule.walk (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\rxjsNoStaticObservableMethodsRule.js:32:54) at E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\rxjsNoStaticObservableMethodsRule.js:24:88 at Rule.AbstractRule.applyWithFunction (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\node_modules\tslint\lib\language\rule\abstractRule.js:39:9) at Rule.applyWithProgram (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\rxjsNoStaticObservableMethodsRule.js:24:28) at Linter.applyRule (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\node_modules\tslint\lib\linter.js:194:29) at E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\node_modules\tslint\lib\linter.js:139:85 at Object.flatMap (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\node_modules\tslint\lib\utils.js:151:29) The 'rxjs-proper-imports' rule threw an error in 'E:\Projects\Sources\WebAdmin.UI.Branch/ClientApp/app/services/local-account.service.ts': TypeError: ts.isStringLiteral is not a function at UpdateOutdatedImportsWalker.visitImportDeclaration (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\rxjsProperImportsRule.js:43:16) at UpdateOutdatedImportsWalker.SyntaxWalker.visitNode (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\node_modules\tslint\lib\language\walker\syntaxWalker.js:392:22) at E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\node_modules\tslint\lib\language\walker\syntaxWalker.js:535:63 at visitEachNode (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\typescript\lib\typescript.js:14785:30) at Object.forEachChild (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\typescript\lib\typescript.js:14959:24) at UpdateOutdatedImportsWalker.SyntaxWalker.walkChildren (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\node_modules\tslint\lib\language\walker\syntaxWalker.js:535:12) at UpdateOutdatedImportsWalker.SyntaxWalker.visitSourceFile (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\node_modules\tslint\lib\language\walker\syntaxWalker.js:228:14) at UpdateOutdatedImportsWalker.SyntaxWalker.visitNode (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\node_modules\tslint\lib\language\walker\syntaxWalker.js:482:22) at UpdateOutdatedImportsWalker.SyntaxWalker.walk (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\node_modules\tslint\lib\language\walker\syntaxWalker.js:24:14) at Rule.AbstractRule.applyWithWalker (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\node_modules\tslint\lib\language\rule\abstractRule.js:31:16)

The 'rxjs-proper-imports' rule threw an error in 'E:\Projects\Sources\WebAdmin.UI.Branch/ClientApp/app/validators/validation-message.component.spec.ts': TypeError: ts.isStringLiteral is not a function at UpdateOutdatedImportsWalker.visitImportDeclaration (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\rxjsProperImportsRule.js:43:16) at UpdateOutdatedImportsWalker.SyntaxWalker.visitNode (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\node_modules\tslint\lib\language\walker\syntaxWalker.js:392:22) at E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\node_modules\tslint\lib\language\walker\syntaxWalker.js:535:63 at visitEachNode (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\typescript\lib\typescript.js:14785:30) at Object.forEachChild (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\typescript\lib\typescript.js:14959:24) at UpdateOutdatedImportsWalker.SyntaxWalker.walkChildren (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\node_modules\tslint\lib\language\walker\syntaxWalker.js:535:12) at UpdateOutdatedImportsWalker.SyntaxWalker.visitSourceFile (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\node_modules\tslint\lib\language\walker\syntaxWalker.js:228:14) at UpdateOutdatedImportsWalker.SyntaxWalker.visitNode (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\node_modules\tslint\lib\language\walker\syntaxWalker.js:482:22) at UpdateOutdatedImportsWalker.SyntaxWalker.walk (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\node_modules\tslint\lib\language\walker\syntaxWalker.js:24:14) at Rule.AbstractRule.applyWithWalker (E:\Projects\Sources\WebAdmin.UI.Branch\node_modules\rxjs-tslint\node_modules\tslint\lib\language\rule\abstractRule.js:31:16) Cannot find any possible migrations

Thanks in advance.

brognilucas commented 6 years ago

@josephjelaskar I'm stayed with the same error and solved using npm install -g typescript.

josephjelaskar commented 6 years ago

@brognilucas Thank you very for your response. I in fact solved it by regenerating vendor-manifest.json.

Once again thank you all..