Error: Cannot find module 'tslint/lib/lint'
With the latest update I am getting the following errors upon running npm start:
ERROR in ./src/vendor.ts
Module build failed: Error: Cannot find module 'tslint/lib/lint'
at Function.Module._resolveFilename (module.js:327:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:355:17)
at require (internal/module.js:13:17)
at Object.<anonymous> (<path-to-app>/node_modules/tslint-loader/formatters/customFormatter.js:1:12)
at Module._compile (module.js:399:26)
at Object.Module._extensions..js (module.js:406:10)
at Module.load (module.js:345:32)
at Function.Module._load (module.js:302:12)
at Module.require (module.js:355:17)
@ multi vendor
ERROR in ./src/bootstrap.ts
Module build failed: Error: Cannot find module 'tslint/lib/lint'
at Function.Module._resolveFilename (module.js:327:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:355:17)
at require (internal/module.js:13:17)
at Object.<anonymous> (<path-to-app>/node_modules/tslint-loader/formatters/customFormatter.js:1:12)
at Module._compile (module.js:399:26)
at Object.Module._extensions..js (module.js:406:10)
at Module.load (module.js:345:32)
at Function.Module._load (module.js:302:12)
at Module.require (module.js:355:17)
@ multi app
I got this too, installed tslint from CLI but got another error:
ERROR in ./src/vendor.ts
Module build failed: Error: ENOENT: no such file or directory, open '<path>\typings\main.d.ts'
at Error (native)
at Object.fs.openSync (fs.js:584:18)
at Object.fs.readFileSync (fs.js:431:33)
at <path>\node_modules\ts-loader\index.js:193:22
at Array.forEach (native)
at ensureTypeScriptInstance (<path>\node_modules\ts-loader\index.js:190:17)
at Object.loader (<path>\node_modules\ts-loader\index.js:375:14)
ERROR in ./src/bootstrap.ts
Module build failed: TypeError: Cannot read property 'getEmitOutput' of null
at Object.loader (<path>\node_modules\ts-loader\index.js:410:33)
I had the same error and solved it by removing the reference of main.d.ts from tsconfig.json. I guess they just forget to remove it.
@mastertinner Try npm install tslint.
@Emnalyeriar @MischaZed Do a typings install.
@blakeembrey, thanks. That worked.
thanks for opening an issue :+1: fix via https://github.com/AngularClass/angular2-webpack-starter/commit/c8f85ed0d9547c48fb598b36ab020229578623c6 and https://github.com/AngularClass/angular2-webpack-starter/commit/614e8d707b35155d642fd05c130e09ed208f29b1
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 Angular CLI has support for codelyzer.Run the below npm command for tslint
npm i tslint-angular