-
Notifications
You must be signed in to change notification settings - Fork 885
Cannot start tslint with npm script #1664
Comments
can you try running |
I have used pwd to determine the fullpath of my project and also tried: |
I just noticed that the help text doesn't include |
@nchen63 I confirmed that it was not the case. Found something new and it was very odd root@.../.../...# npm install typescript -g
/usr/bin/tsc -> /usr/lib/node_modules/typescript/bin/tsc
/usr/bin/tsserver -> /usr/lib/node_modules/typescript/bin/tsserver
/usr/lib
└── typescript@2.0.9
root@.../.../...# npm install -g tslint
/usr/bin/tslint -> /usr/lib/node_modules/tslint/bin/tslint
/usr/lib
├── tslint@3.15.1
└── UNMET PEER DEPENDENCY typescript@>=1.7.3 |
@bertolo1988 that looks like #1003 |
@bertolo1988 Try changing your lint script to |
the reason I ask is because you listed 3.15.1 in your bug report. the |
ah, sorry, can you run |
3.15.1 |
well, I don't know what to say. Your help text does not give the |
Haven't seen such problem, but I can guess only next options to try at first:
|
I removed my global installation. Now i cannot run tslint on my console. I installed it locally and the version inside is If i try to run If i set a npm script such as
I think that only the global installation should allow me to run tslint. Installed as a npm module, it would only be accessible by using require/import. IMPORTANT: Running tslint globally works well, when installed locally and running as an npm script i get this error |
@bertolo1988 does it works as expected now? |
@IllusionMH No wait. i "isolated" the problem a bit better. There is a problem still. Check my previous comment. |
@bertolo1988 if I understand correctly - you've managed to install 3.15.1 to the project (which was root case for problem with In short - this is just NPM detailed reaction on exit code when there are lint errors. P.S. To be sure that you run same package version as your build tools and CI - I personally prefer to use npm scripts or use packages from local installations like |
I just confirmed that if there are no lint errors, it ends the execution just fine. I think that you should place a big warning in the repo readme for this because most of people will most likely run tslint with a npm script and get confused with the errors, just like me. Thanks alot for your help. ;) |
Just spent half an hour fighting this issue. You should really add the warning somewhere about this use case, cause it's really a standard now to call such scripts using |
Just ran into this issue and had to dig this up, posting for posterity. I personally didn't like my
As written, this will never fail. Use with caution. I just personally couldn't stand the huge NPM error messages. Alternatively, using
|
…f its locally installed. - add script to run tslint, add a bit of cleanup to script to deal with annoying npm error message which shows up if there are linting errors: palantir/tslint#1664 (comment) modified: package.json
Fix tslint path. Issue in palantir/tslint#1664
🤖 Beep boop! 👉 TSLint is deprecated 👈 and you should switch to typescript-eslint! 🤖 🔒 This issue is being locked to prevent further unnecessary discussions. Thank you! 👋 |
Bug Report
3.15.1
2.0.6
If i type `tslint --project .' it works:
If i run the same command with an npm script i get:
And this is what i get in my npm-debug.log
The text was updated successfully, but these errors were encountered: