Closed exequiel09 closed 6 years ago
The ng serve
error might be related to: https://github.com/angular/angular-cli/issues/10163
I've looked into this a bit. The first thing to fix in nx is our package.json. These dependencies get us half way there:
{
"name": "blah",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "./node_modules/.bin/nx lint && ng lint",
"e2e": "ng e2e",
"affected:apps": "./node_modules/.bin/nx affected apps",
"affected:build": "./node_modules/.bin/nx affected build",
"affected:e2e": "./node_modules/.bin/nx affected e2e",
"format": "./node_modules/.bin/nx format write",
"format:write": "./node_modules/.bin/nx format write",
"format:check": "./node_modules/.bin/nx format check",
"update": "./node_modules/.bin/nx update",
"update:check": "./node_modules/.bin/nx update check",
"update:skip": "./node_modules/.bin/nx update skip",
"postinstall": "./node_modules/.bin/nx postinstall"
},
"private": true,
"dependencies": {
"@angular/animations": "6.0.0-rc.1",
"@angular/common": "6.0.0-rc.1",
"@angular/compiler": "6.0.0-rc.1",
"@angular/core": "6.0.0-rc.1",
"@angular/forms": "6.0.0-rc.1",
"@angular/platform-browser": "6.0.0-rc.1",
"@angular/platform-browser-dynamic": "6.0.0-rc.1",
"@angular/router": "6.0.0-rc.1",
"core-js": "^2.4.1",
"rxjs": "6.0.0-beta.4",
"zone.js": "^0.8.19",
"@nrwl/nx": "0.10.0-beta.1",
"@ngrx/effects": "6.0.0-beta.1",
"@ngrx/router-store": "5.0.1",
"@ngrx/store": "6.0.0-beta.1",
"@ngrx/store-devtools": "6.0.0-beta.1",
"ngrx-store-freeze": "^0.2.1"
},
"devDependencies": {
"@angular/cli": "6.0.0-rc.0",
"@angular/compiler-cli": "6.0.0-rc.1",
"@nrwl/schematics": "0.10.0-beta.1",
"@angular/language-service": "6.0.0-rc.1",
"@schematics/angular": "^0.5.0",
"@schematics/update": "^0.5.0",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"cosmiconfig": "^4.0.0",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "2.7.2",
"prettier": "1.10.2"
}
}
The second half of the migration will involve migrating to RxJS 6.0. Currently, with the set of dependencies we have the following error is produced by ng serve
ERROR in node_modules/@nrwl/nx/src/data-persistence.d.ts(5,10): error TS2305: Module '"/Users/mrmeku/temp/blah/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'.
But as for the original error that was produced about cosmiconfig
not being found, that's an error with the angular cli. It should have listed the package as a peer dependency
The second error about not being able to run the cli migration can be resolved by adding two dependencies (which again should be been peer dependencies of the cli)
"@schematics/angular": "^0.5.0",
"@schematics/update": "^0.5.0",
A comment about compatibility with Angular 6 :
Closing since Nx now supports Angular CLI v6.
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Angular CLI
v6.0.0-rc.0
has been released an hour ago so i went on trying to upgrade some Angular dependencies to test it out. And here are the results:After the upgrade,
postinstall
command throws an error.So even if the
postinstall
command has thrown in an error, out of curiosity i tried running theserve
commandVersions