Giter Club home page Giter Club logo

Comments (31)

alexeden avatar alexeden commented on August 15, 2024 78

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

from rxjs-tslint.

grumpy-programmer avatar grumpy-programmer commented on August 15, 2024 50

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

from rxjs-tslint.

mgechev avatar mgechev commented on August 15, 2024 19

@cbchenoweth thanks for sharing! In such case, you should be able to workaround the issue by running:

npm i -g tslint

from rxjs-tslint.

mgechev avatar mgechev commented on August 15, 2024 6

@cbchenoweth correct

from rxjs-tslint.

cbchenoweth avatar cbchenoweth commented on August 15, 2024 6

@melodysummer
If you want to run the "rxjs-5-to-6-migrate" command, I think you must also install this package globally.
So:
npm install -g rxjs-tslint

Alternatively, you can just configure the tsLint rules in your project as described in the readme:
https://github.com/ReactiveX/rxjs-tslint/blob/master/README.md#use-rules

from rxjs-tslint.

cec avatar cec commented on August 15, 2024 4

I have the same issue.

Windows 10
Node 8.9.4
NPM 5.6.0

[email protected]
[email protected]
[email protected]

from rxjs-tslint.

flauc avatar flauc commented on August 15, 2024 4

Same thing also on windows

Windows 10
Node 9.3.0
NPM 6.0.0

[email protected]
[email protected]
[email protected]

from rxjs-tslint.

leiturix avatar leiturix commented on August 15, 2024 3

I think the problem is another one.
Look at into the /src if the name file is ''tsconfig.app.json" or is "tsconfig.json"
In my case, i only changed to correct name.

from rxjs-tslint.

blackholegalaxy avatar blackholegalaxy commented on August 15, 2024 2

On macOS it's the same

macOS 10.13.4
Node 9.3.0
npm 6.0.0

[email protected]
[email protected]
[email protected]

from rxjs-tslint.

b-mi avatar b-mi commented on August 15, 2024 2

After installing tslint, typescript globally and locally - despite of false npm warnings about typescript missing - rxjs-5-to-6-migrate -p src/tsconfig.app.json helped. Documentation is bad - "rxjs-5-to-6-migrate -p [path/to/tsconfig.json]" is bad description. Cannot use tsconfig.json, cannot use "rxjs-5-to-6-migrate -p" without optional path. Have to use rxjs-5-to-6-migrate -p src/tsconfig.app.json.

Correct documentation.

from rxjs-tslint.

krishna-kumar06 avatar krishna-kumar06 commented on August 15, 2024 2

Please check path of tsconfig.json. In my case it was src/tsconfig.app.json but i changed it to src/client/tsconfig.json and its working.
So i did 2 changes

  1. correct name of tsconfig.json (removed app)
  2. correct path of this file

from rxjs-tslint.

cbchenoweth avatar cbchenoweth commented on August 15, 2024 1

@mgechev ok, so, just to make sure my understanding is correct:
The command "rxjs-5-to-6-migrate" is essentially just doing a "tslint --fix"?

So, as long as I did the steps to set up the rules directly in my tslint.json,
the command is really not needed?

from rxjs-tslint.

atodd-geoplan avatar atodd-geoplan commented on August 15, 2024 1

Ach hate these. One blog says run this, it doesn't work and the creators have no idea.

For a start it says run it against src/tsconfig.app.json

But that file does not get generated by ng-cli there, it generates:

src/tsconfig.json
src/app/tsconfig.app.json
src/app/tsconfig.spec.json

So which is it? FWIW ALL fail the same way and nothing suggested thus far solves it.

Love a simple upgrade path!

from rxjs-tslint.

MickL avatar MickL commented on August 15, 2024 1

Install globally as described in readme or use npx: npx rxjs-5-to-6-migrate -p src/tsconfig.app.json

Please close this issue as it works as described in readme.

from rxjs-tslint.

ziacik avatar ziacik commented on August 15, 2024 1

For me, running the failed command mentioned in the error manually, e.g. /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, revealed me the real error.

For me, it was a messed up tsconfig.json: tsconfig.json(11,3): error TS5023: Unknown compiler option 'preserveWhitespaces'

from rxjs-tslint.

sayantansinha avatar sayantansinha commented on August 15, 2024 1

@ziacik Thanks, your solution worked for me, running the failed command showed the actual error and now it is running :)

However, this is what the angular update guide says which is why I added it in the first place, something doesn't add up, as it seems like this is not a valid option in the tsconfig file

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.

from rxjs-tslint.

royakaacky avatar royakaacky commented on August 15, 2024 1

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

Why it is necessary to call 'npm install' inside the 'node_modules/rxjs-tslint' folder? It works. But i dont understand why. When i call npm install rxjs-tslint, i assume, that all dependecies will be installed.

Can you explain me this, please?

from rxjs-tslint.

liwonder avatar liwonder commented on August 15, 2024 1

I have this issue also when I try to update my Angular5 project to V7. After I tried all the above but still can't get any thing done.
Finally I found some clue other where, you should update your typescript globally as well, that seems works for me.
Clue here: #49

from rxjs-tslint.

loicsalou avatar loicsalou commented on August 15, 2024

same issue for me, Win7, node64 (8.11.x)

also tested with node32 (8.11.x) et node64 (10.1.0), same issue

from rxjs-tslint.

cbchenoweth avatar cbchenoweth commented on August 15, 2024

Same error here.
Looking at the error stack, I think this is the culprit:

filenotfound

This is on version 0.1.3

from rxjs-tslint.

cbchenoweth avatar cbchenoweth commented on August 15, 2024

@mgechev thanks for the tip, will try that.

In general I try to avoid global installs,
easier to make sure that everything is set up right in the project.
(since, when it gets run through CI pipeline, there will be no globals)

I assume this is still something that should be fixed?

from rxjs-tslint.

mgechev avatar mgechev commented on August 15, 2024

@cbchenoweth you don't have to use a global binary. Since these are tslint rules, you can apply them with local tslint installation & the config from the repo.

The global just makes it more convenient to use.

from rxjs-tslint.

melodysummer avatar melodysummer commented on August 15, 2024

so how to resolve the problem?
I also met with the running error..
It didn't work after running "npm i -g tslint"

from rxjs-tslint.

melodysummer avatar melodysummer commented on August 15, 2024

thanks @cbchenoweth i'll try that

from rxjs-tslint.

sandraandonov88 avatar sandraandonov88 commented on August 15, 2024

I am experiencing the same error.

Windows 10
Node 9.3.0
NPM 6.0.0

[email protected]
[email protected]
[email protected]

from rxjs-tslint.

mgechev avatar mgechev commented on August 15, 2024

I can see a few solutions to the problem here.

from rxjs-tslint.

candidJ avatar candidJ commented on August 15, 2024

I'm getting 'Cannot find any possible migrations' after running the migration command

from rxjs-tslint.

moshmage avatar moshmage commented on August 15, 2024

@candidJ did you ever fix that or did you have to re-write every sibscribe by hand? (I'm getting the same output)

from rxjs-tslint.

Diandres avatar Diandres commented on August 15, 2024

@leiturix

I think the problem is another one.
Look at into the /src if the name file is ''tsconfig.app.json" or is "tsconfig.json"
In my case, i only changed to correct name.

this guy is a genius

from rxjs-tslint.

PineauSullivan avatar PineauSullivan commented on August 15, 2024

Hi,
I have a problem when I execute the command :
./node_modules/.bin/rxjs-5-to-6-migrate -p src/tsconfig.app.json

I have the following error (in french) :

Running the automatic migrations. Please, be patient and wait until the execution completes.
Le chemin d'accès spécifié est introuvable.
Error while running the migration: ,,Le chemin d'accès spécifié est introuvable.

This file exists...
Do you have an idea to help me ?

Thank you for the help

from rxjs-tslint.

ginid-mansa avatar ginid-mansa commented on August 15, 2024

@cbchenoweth thanks for sharing! In such case, you should be able to workaround the issue by running:

npm i -g tslint

This worked for me
thanks

from rxjs-tslint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.