You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Error: Cannot find module 'tslint/lib/lint'" when running npm run lint #1189
Originally submitted as an issue to the codelyzer project but got redirected here. See original issue here - mgechev/codelyzer#159
I'm submitting a ...
[x] bug report
[ ] feature request
[ ] question about the decisions made in the repository
What is the current behavior?
Running npm run lint from the latest angular2-webpack-starter repo causes the following error that seems to be originating from importDestructuringSpacingRule.js which wasn't happening a few days ago.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
Pull latest master
Run npm run lint to produce error
What is the expected behavior? npm run lint shouldn't error
What is the motivation / use case for changing the behavior?
For projects to be able to continnue using linting features as part of build success criteria.
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
Here's a print out of the console at the point it errors -
> angular2-webpack-starter@5.1.1 lint C:\Users\ammar.haider\oakbrook\angular2-webpack-starter
> npm run tslint "src/**/*.ts"
> angular2-webpack-starter@5.1.1 tslint C:\Users\ammar.haider\oakbrook\angular2-webpack-starter
> tslint "src/**/*.ts"
no-unused-variable is deprecated. Use the tsc compiler options --noUnusedParameters and --noUnusedLocals instead.
module.js:471
throw err;
^
Error: Cannot find module 'tslint/lib/lint'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\ammar.haider\oakbrook\angular2-webpack-starter\node_modules\codelyzer\importDestructuringSpacingRule.js:8:12)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
changed the title [-]importDestructuringSpacingRule.js from codelyzer causing "Error: Cannot find module 'tslint/lib/lint'"[/-][+]"Error: Cannot find module 'tslint/lib/lint'" when running npm run lint[/+]on Nov 21, 2016
@satishgoud This shouldn't be an issue anymore as latest Codelyzer supports tslint@4.0.0 but for clarity I meant that fixing the tslint package to a specific version fixed the issue when it existed... "tslint": "4.0.0-dev.1",
Activity
[-]importDestructuringSpacingRule.js from codelyzer causing "Error: Cannot find module 'tslint/lib/lint'"[/-][+]"Error: Cannot find module 'tslint/lib/lint'" when running npm run lint[/+]avril-verhaeghen commentedon Nov 22, 2016
Having the same issue here
ammarhaider7 commentedon Nov 22, 2016
@avril-verhaeghen Just fixed this by locking down tslint to
@4.0.0-dev.1avril-verhaeghen commentedon Nov 22, 2016
Yeah, just found this out too :-), but thanks for sharing :-)
bburttram commentedon Nov 22, 2016
Thank you, that fix worked for me as well.
chore(package): #1189 revert tslint version upgrade
chore(package): #1189 revert tslint version upgrade
chore(package): #1189 revert tslint version upgrade
ci(Travis): CI fixes and improvments
ci(Travis): CI fixes and improvments (#1206)
mgechev commentedon Nov 28, 2016
Codelyzer@^2.0.0-beta.1 now supports external templates and tslint@^4.0.0.
satishgoud commentedon Jan 20, 2017
@ammarhaider7
I didn't get what you said, can you please clarify.
ammarhaider7 commentedon Jan 24, 2017
@satishgoud This shouldn't be an issue anymore as latest Codelyzer supports tslint@4.0.0 but for clarity I meant that fixing the tslint package to a specific version fixed the issue when it existed...
"tslint": "4.0.0-dev.1",ci(Travis): CI fixes and improvments (PatrickJS#1206)
SatishMHiremath commentedon Mar 6, 2018
Codelyzer
A set of tslint rules for static code analysis of Angular TypeScript projects.
You can run the static code analyzer over web apps, NativeScript, Ionic, etc.
Angular CLI has support for codelyzer.Run the below npm command for tslint
npm i tslint-angular