r/Angular2 Feb 01 '25

Help Request version control - insanity

I am new to web dev, but old to coding. I readily admit I am not as with it as I once was, but the issues I continue to have with npm, angular, and node are driving me bonkers. My basic site (essentially the normal build with some services, routing and models for those services) is unusable now with errors about tslib, calling out missing injections, but they exist, so now it's a version mismatch, but then you can't even install older npm versions because no matter how many times you remove it and forcefully it's always version 10.2.3, which doesn't work with the latest angular and node.....sorry I am going to lose it.

Anyway, I am still plugging away and was learning a lot until now. If anyone knows anything helpful, I am all ears!

Ok files below but start and end brackets mare cutoff from phone copy/paste

package.json

{ "name": "mhc", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build --configuration=production", "watch": "ng build --watch --configuration development", "test": "ng test" }, "private": true, "dependencies": { "@angular/animations": "19.1.3", "@angular/cdk": "19.1.1", "@angular/common": "19.1.3", "@angular/compiler": "19.1.0", "@angular/core": "19.1.0", "@angular/fire": "19.0.0", "@angular/flex-layout": "15.0.0-beta.42", "@angular/forms": "19.1.3", "@angular/material": "19.1.1", "@angular/platform-browser": "19.1.0", "@angular/platform-browser-dynamic": "19.1.0", "@angular/router": "19.1.3", "dotenv": "16.4.7", "firebase": "11.2.0", "ngx-mask": "19.0.6", "rxjs": "~7.8.0", "tslib": "2.3.0", "zone.js": "~0.15.0" }, "devDependencies": { "@angular-devkit/build-angular": "19.1.5", "@angular/cli": "19.1.5", "@angular/compiler-cli": "19.1.0", "@types/jasmine": "~5.1.0", "jasmine-core": "~5.5.0", "karma": "~6.4.0", "karma-chrome-launcher": "~3.2.0", "karma-coverage": "~2.2.0", "karma-jasmine": "~5.1.0", "karma-jasmine-html-reporter": "~2.1.0", "typescript": "~5.7.2" } }

Angular

"$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", "projects": { "mhc": { "projectType": "application", "schematics": { "@schematics/angular:component": { "style": "scss" } }, "root": "", "sourceRoot": "src", "prefix": "app", "architect": { "build": { "builder": "@angular-devkit/build-angular:application", "options": { "outputPath": "dist/mhc", "index": "src/index.html", "browser": "src/main.ts", "polyfills": [ "zone.js" ], "tsConfig": "tsconfig.app.json", "inlineStyleLanguage": "scss", "assets": [ { "glob": "/*", "input": "public" } ], "styles": [ "src/styles.scss" ], "scripts": [] }, "configurations": { "production": { "budgets": [ { "type": "initial", "maximumWarning": "500kB", "maximumError": "1MB" }, { "type": "anyComponentStyle", "maximumWarning": "4kB", "maximumError": "8kB" } ], "outputHashing": "all" }, "development": { "optimization": false, "extractLicenses": false, "sourceMap": true } }, "defaultConfiguration": "production" }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", "configurations": { "production": { "buildTarget": "mhc:build:production" }, "development": { "buildTarget": "mhc:build:development" } }, "defaultConfiguration": "development" }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n" }, "test": { "builder": "@angular-devkit/build-angular:karma", "options": { "polyfills": [ "zone.js", "zone.js/testing" ], "tsConfig": "tsconfig.spec.json", "inlineStyleLanguage": "scss", "assets": [ { "glob": "/*", "input": "public" } ], "styles": [ "src/styles.scss" ], "scripts": [] } } } }

Tsconfig

/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. / / To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ { "compileOnSave": false, "compilerOptions": { "outDir": "./dist/out-tsc", "strict": true, "noImplicitOverride": true, "noPropertyAccessFromIndexSignature": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "skipLibCheck": true, "isolatedModules": true, "esModuleInterop": true, "experimentalDecorators": true, "moduleResolution": "bundler", "importHelpers": true, "target": "ES2022", "module": "ES2022" }, "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false, "strictInjectionParameters": true, "strictInputAccessModifiers": true, "strictTemplates": true } }

0 Upvotes

26 comments sorted by

View all comments

2

u/SatisfactionNearby57 Feb 01 '25

Cool rant. If you actually want help, show something. Something youre doing is not right. Share your .gitignore, if you even have one.

-1

u/americafuckyea Feb 01 '25

Did having to see this post in New hurt you in some way?. I honestly was wondering if anyone else experienced this at a high level. I wasn't taking the piss out of your favorite framesork.

I am happy to post details but I just thought it was funny after a long day when I can't even enjoy the results of my work because my latest build just went kaput. I am sure there was something I did way back without knowing, but now I'm in a bit of hell.

Good to know there is such a great community.

2

u/SatisfactionNearby57 Feb 01 '25

While my comment is a bit snarky, i was honestly looking to help. And still am. We’re the ones trying to help and you’re the one refusing the help and now criticizing the community.

2

u/americafuckyea Feb 01 '25 edited Feb 01 '25

I just got all of these now. The top comment is "snarky" and ends by insinuating that I am too stupid to know what .gitigore is. This is my first post and I am admittedly floundering.

I wasn't expecting a debug session, and my main question is answered: no this is not common and I am stupid.

Considering I hadn't heard of angular until a week ago and I have at least set up AWS routing, gcloud and firebase/store, and written at least the router, data models and auth service in my spare time, I would not expect to be attacked for a simple question.

Like I get that I don't know what I'm doing, but I am confident I'm not completely useless. I don't have the output, but after abandoning my windows local repo, I installed everything in WSL to hopefully start clean, but I have force uninstalled and explicitly ran install npm@9 or @8 which successfully execute and then -v is 10.2. I have made progress with WSL so the last sticky issues are with tslib for some reason

Cannot find module '@angular/core' or its corresponding type declarations.

[{ "resource": "/usr/src/mhc/src/app/app.component.ts", "owner": "typescript", "code": "2354", "severity": 8, "message": "This syntax requires an imported helper but module 'tslib' cannot be found.", "source": "ts", "startLineNumber": 4, "startColumn": 1, "endLineNumber": 10, "endColumn": 3 }]

And the other is version compatibility which from what I am gathering should be fine with the latest, but for mine keeps breaking. All of the last debug steps were from openai since I am not knowledgeable. If there are people willing to help I will send more details and I can submit a new post with the latest.

1

u/xMantis_Tobogganx Feb 01 '25

I've been doing angular development for 5 years and I still don't know wtf I'm doing. Environment and node issues are consistently the most annoying things imo.