When running npm run lint
go through all linting.
When I'm running a npm run lint
I'm getting an error An unhandled exception occurred: Could not find module "@nrwl/linter"
.
The following code in angular.json causes this:
"lint": {
"builder": "@nrwl/linter:lint",
"options": {
"linter": "tslint",
"tsConfig": ["apps/ditectrev-e2e/tsconfig.e2e.json"],
"exclude": ["**/node_modules/**", "!apps/ditectrev-e2e/**"]
}
}
Changing to the following lints all the files in the workspace correctly again (taken from older versions):
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["apps/ditectrev-e2e/tsconfig.e2e.json"],
"exclude": ["**/node_modules/**", "!apps/ditectrev-e2e/**"]
}
}
Or simply npm install @nrwl/linter --save-dev
, but the module @nrwl/linter
is not included in a freshly generated Nx workspace. I see that @nrwl/linter is a very fresh package, but at this point of time (yesterday) it has been not included in devDependencies
.
Would be great to have it in a freshly generated workspace correctly.
An unhandled exception occurred: Could not find module "@nrwl/linter"
npm run lint
$ ng version
Angular CLI: 8.1.2
Node: 10.15.3
OS: win32 x64
Angular: 8.2.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.801.1
@angular-devkit/build-angular 0.800.6
@angular-devkit/build-optimizer 0.800.6
@angular-devkit/build-webpack 0.800.6
@angular-devkit/core 8.1.1
@angular-devkit/schematics 8.1.1
@angular/cli 8.1.1
@ngtools/webpack 8.0.6
@schematics/angular 8.1.1
@schematics/update 0.801.1
rxjs 6.4.0
typescript 3.4.5
webpack 4.30.0
$ npm ls @nrwl/angular @nrwl/workspace
+-- @nrwl/[email protected]
`-- @nrwl/[email protected]
$ npm ls @angular/cli
`-- @angular/[email protected]
It has been checked with Angular.
@danieldanielecki could you provide a repository with a repro?
@nrwl/web
has a dependency on @nrwl/linter
, so I'm curious what your package-lock.json file looks like.
I found the issue. The user only has an Angular project so there is no dependency on @nrwl/web
or @nrwl/node
and thus no dependency on @nrwl/lint
.
Fixed by #1692