0
I’ve resumed my studies with Angular 2, and I’m trying to rebuild the design of this link step by step, but when executing the update of packages with npm update
I can no longer test the project with ng serve
, receiving various package absence or other error messages.
for example:
ERROR in ./~/@angular/material/esm5/icon.es5.js
Module not found: Error: Can't resolve '@angular/common/http' in 'C:\Users\Admin\workspace\islan\angular2-rss-reader2\node_modules\@angular\material\esm5'
@ ./~/@angular/material/esm5/icon.es5.js 9:0-50
@ ./~/@angular/material/esm5/material.es5.js
@ ./src/app/app.module.ts
@ ./src/app/index.ts
@ ./src/main.ts
@ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts
Considering a standard installation made of Angular 2 on the date of 10/07/2019
, and a project created with ng new
, what are the versions of the packages below most indicated for the project to be successfully compiled?
"dependencies": {
"@angular/common": "",
"@angular/compiler": "",
"@angular/core": "",
"@angular/forms": "",
"@angular/http": "",
"@angular/platform-browser": "",
"@angular/platform-browser-dynamic": "",
"@angular/router": "",
"@angular/material": "",
"@angular/cdk": "",
"@angular/animations": "",
"core-js": "",
"rxjs": "",
"ts-helpers": "",
"zone.js": ""
},
"devDependencies": {
"@angular/compiler-cli": "",
"@types/jasmine": "",
"@types/node": "",
"angular-cli": "",
"codelyzer": "",
"jasmine-core": "",
"jasmine-spec-reporter": "",
"karma": "",
"karma-chrome-launcher": "",
"karma-cli": "",
"karma-jasmine": "",
"karma-remap-istanbul": "",
"protractor": "",
"ts-node": "",
"tslint": "",
"typescript": ""
}
Grateful
I confess that I get very lost when using Angular, are many versions totally incompatible, I use Nativescript and always receive messages saying I must migrate to version 6, I can not use now neither the 7 nor the 8 and it is not productive to keep changing version continuously, I’m trying to do exactly this, I created the new project, and I’ve been copying the app fonts, but it never works, and in the end it turns into a version room.
– Delfino
Another interesting fact, when creating a new project with
ng new
packages are used in version 2.., already in nativescript is using version packages^8.*.*
.– Delfino
ng new refers to the angular version - cli installed
– Eduardo Vargas
Well, I use the nativescript and everything is ok, and I don’t want to change anything because I confess that I fear for the health of the project. I will act globally to see what happens.
– Delfino
Unfortunately I can not upgrade to the latest version, it requires the Node 10 and I will have problems with other projects, and now maintain several installations will not be viable.
– Delfino
Look, I have a teammate who uses two versions of Angular (7 and 8 in the case). I don’t know how he did it, but I believe it would help you in this problem, and move the other projects to the most current version, and let the others run in the production in the old version.
– Edward Ramos
The interesting thing is to update yourself. Loiane (youtuber) has videos showing how to move from one version to the other. Maybe this will help you in the future migration.
– Edward Ramos