Angular 6 aspnetcore angular/compiler-cli to be 2.3.1 or greater - asp.net-core

I create an application with visual studio 2017
ASP.Net core
angular
the template come with angular 4
I updated for angular 6.1.3
but I get this error
crit: Microsoft.AspNetCore.Hosting.Internal.WebHost[6]
Application startup exception
System.AggregateException: One or more errors occurred. (Version of #angular/compiler-cli needs to be 2.3.1 or greater. Current version is "6.1.3".
here is my package.json
{
"name": "WebApplication1",
"private": true,
"version": "0.0.0",
"scripts": {
"test": "karma start ClientApp/test/karma.conf.js"
},
"devDependencies": {
"#angular/animations": "6.1.3",
"#angular/common": "6.1.3",
"#angular/compiler": "6.1.3",
"#angular/compiler-cli": "^6.1.3",
"#angular/core": "6.1.3",
"#angular/forms": "6.1.3",
"#angular/http": "6.1.3",
"#angular/platform-browser": "6.1.3",
"#angular/platform-browser-dynamic": "6.1.3",
"#angular/platform-server": "6.1.3",
"#angular/router": "6.1.3",
"#ngtools/webpack": "1.5.0",
"#types/chai": "4.0.1",
"#types/jasmine": "2.5.53",
"#types/webpack-env": "1.13.0",
"aspnet-prerendering": "^3.0.1",
"aspnet-webpack": "^2.0.3",
"awesome-typescript-loader": "3.2.1",
"bootstrap": "^4.1.3",
"chai": "4.0.2",
"css": "2.2.1",
"css-loader": "0.28.4",
"es6-shim": "0.35.3",
"event-source-polyfill": "0.0.9",
"expose-loader": "0.7.3",
"extract-text-webpack-plugin": "2.1.2",
"file-loader": "0.11.2",
"html-loader": "0.4.5",
"isomorphic-fetch": "2.2.1",
"jasmine-core": "2.6.4",
"jquery": "3.2.1",
"json-loader": "0.5.4",
"karma": "1.7.0",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-jasmine": "1.1.0",
"karma-webpack": "2.0.3",
"preboot": "4.5.2",
"raw-loader": "0.5.1",
"reflect-metadata": "0.1.10",
"rxjs": "6.2.2",
"style-loader": "0.18.2",
"to-string-loader": "1.1.5",
"typescript": "2.9.2",
"url-loader": "0.5.9",
"webpack": "2.5.1",
"webpack-hot-middleware": "2.18.2",
"webpack-merge": "4.1.0",
"zone.js": "0.8.26"
},
"dependencies": {
"#angular/cli": "^6.1.4",
"popper.js": "^1.14.4",
"rxjs-compat": "^6.0.0-rc.0"
}
}

Related

ERROR in node_modules/export-from-json/dist/types/index.d.ts(2,13): error TS1005: '=' expected

I'm using angular version 6. After cloning the repo I did npm i. After that I did npm run start and facing this issue as shown below
Here is my package.json file
{
"name": "somaf",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy.config.json --port=4300 --disable-host-check",
"build": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/animations": "^6.1.0",
"#angular/cdk": "^6.2.0",
"#angular/common": "^6.1.0",
"#angular/compiler": "^6.1.0",
"#angular/core": "^6.1.0",
"#angular/forms": "^6.1.0",
"#angular/http": "^6.1.0",
"#angular/material": "^6.4.7",
"#angular/platform-browser": "^6.1.0",
"#angular/platform-browser-dynamic": "^6.1.0",
"#angular/router": "^6.1.0",
"ang-jsoneditor": "^1.10.4",
"angular-user-idle": "^2.2.7",
"angular2-promise-buttons": "^3.0.0",
"core-js": "^2.5.4",
"export-from-json": "^1.4.1",
"json-formatter-js": "^2.3.4",
"jsoneditor": "^9.7.4",
"rxjs": "6.2.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"#angular-devkit/build-angular": "~0.8.0",
"#angular/cli": "~6.2.9",
"#angular/compiler-cli": "^6.1.0",
"#angular/language-service": "^6.1.0",
"#types/jasmine": "~2.8.8",
"#types/jasminewd2": "~2.0.3",
"#types/node": "~8.9.4",
"codelyzer": "~4.3.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^6.3.19",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"node-sass": "^4.14.1",
"protractor": "^7.0.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "^2.9.2",
"webpack": "^4.16.4"
}
}
I have tried updating the typescript version by removing '~' and adding '^' also updated the rxjs version by removing the '~' but did not work for me.

SAP Spartacus Unhandled Promise rejection: R3InjectorError(AppModule)[ApplicationModule

Hi I'm having an issue with using Spartacus 4.3 in zone.js. Build is successful but I cannot view my local since it has an issue with Unhandled Promise rejection: R3InjectorError(AppModule)[ApplicationModule. Please advise
Heres what's inside my package.json
"dependencies": {
"#angular/animations": "~12.2.16",
"#angular/common": "~12.2.16",
"#angular/compiler": "~12.2.16",
"#angular/core": "~12.2.16",
"#angular/forms": "~12.2.16",
"#angular/platform-browser": "~12.2.16",
"#angular/platform-browser-dynamic": "~12.2.16",
"#angular/router": "~12.2.16",
"#angular/service-worker": "^12.0.5",
"#ng-bootstrap/ng-bootstrap": "^10.0.0",
"#ng-select/ng-select": "^7.0.1",
"#ngrx/effects": "^12.1.0",
"#ngrx/router-store": "^12.1.0",
"#ngrx/store": "^12.1.0",
"#spartacus/asm": "~4.3.8",
"#spartacus/assets": "~4.3.8",
"#spartacus/cart": "~4.3.8",
"#spartacus/checkout": "~4.3.8",
"#spartacus/core": "~4.3.8",
"#spartacus/order": "~4.3.8",
"#spartacus/product": "~4.3.8",
"#spartacus/smartedit": "~4.3.8",
"#spartacus/storefinder": "~4.3.8",
"#spartacus/storefront": "~4.3.8",
"#spartacus/styles": "~4.3.8",
"#spartacus/tracking": "~4.3.8",
"#spartacus/user": "~4.3.8",
"angular-oauth2-oidc": "^10.0.1",
"bootstrap": "^4.3.1",
"i18next": "^20.2.2",
"i18next-http-backend": "^1.2.2",
"ngx-infinite-scroll": "^8.0.0",
"rxjs": "~6.5.4",
"tslib": "^2.0.0",
"zone.js": "~0.11.4",
"#angular/platform-server": "~10.1.0",
"#ngrx/store-devtools": "^8.6.0",
"#nguniversal/express-engine": "^10.1.0",
"#spartacus/setup": "^3.0.0-rc.2",
"express": "^4.15.2",
"ts-loader": "^6.0.4",
"#types/express": "^4.17.0",
"#angular/material-moment-adapter": "^9.1.2",
"#ng-dynamic-forms/core": "^14.0.1",
"#ng-dynamic-forms/ui-material": "^14.0.1",
"angular2-text-mask": "^9.0.0",
"country-flag-icons": "^1.1.1",
"fastify": "^2.12.0",
"jquery": "^3.4.1",
"lodash-es": "^4.17.15",
"material-dynamic-table": "^9.4.0",
"moment-jdateformatparser": "^1.2.1",
"ng-connection-service": "^1.0.4",
"ng-recaptcha": "^5.0.0",
"ng2-sticky-kit": "^6.1.0",
"ngx-cookie": "^4.1.2",
"ngx-cookie-service": "^3.0.3",
"ngx-device-detector": "1.4.6",
"ngx-image-zoom": "^1.0.1",
"ngx-moment": "^5.0.0",
"ngx-slick-carousel": "^0.4.7",
"popper.js": "^1.16.0",
"slick-carousel": "^1.8.1",
"ngx-mask": "^13.1.13",
"#angular/localize": "^12.0.5"
},
"devDependencies": {
"#angular-devkit/build-angular": "~12.2.18",
"#angular-devkit/schematics": "^12.0.5",
"#angular/cli": "~12.2.18",
"#angular/compiler-cli": "~12.2.16",
"#spartacus/schematics": "4",
"#types/jasmine": "~3.6.0",
"#types/jasminewd2": "~2.0.3",
"#types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.4.1",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~4.3.5",
"#angular/material": "^12.2.13",
"#angular/cdk": "^12.2.13",
"angular2-template-loader": "0.6.2",
"babel-loader": "^8.0.6",
"element-closest-polyfill": "1.0.0",
"file-saver": "^2.0.2",
"hammerjs": "^2.0.8",
"husky": "^4.3.0",
"moment": "^2.24.0",
"prettier": "^2.2.0",
"prettier-plugin-organize-imports": "^1.1.1",
"pretty-quick": "^3.1.0",
"ts-loader": "^6.0.4",
"webpack-cli": "^3.3.2",
"#nguniversal/builders": "^10.1.0"
},
is this related to this? https://github.com/SAP/spartacus/issues/11016
Hi was able to fixed the issue due to router module. Some modules requred in router module was not present.

Angular 10 npm error hasBindingPropertyName is not a function

I am getting this error all of sudden in Jenkins build, i tried upgrading to latest Angular that is 10.1 but even after upgrading issue is not resolved. So i rolled back to Angular 10.0, package.json dependencies below
[09/11/2020 03:26:56.420] - Build:: Compiling
#angular/platform-browser-dynamic/testing : es2015 as esm2015
[09/11/2020 03:27:09.120] - Build:: Error: Error on worker #5:
TypeError: dir[ioType].hasBindingPropertyName is not a function
[09/11/2020 03:27:09.120] - Build:: at
Project_folder/node_modules/#angular/compiler/bundles/compiler.umd.js:30061:79
[09/11/2020 03:27:09.120] - Build:: at Array.find ()
[09/11/2020 03:27:09.120] - Build:: at setAttributeBinding
Package.json
"dependencies": {
"#angular-devkit/build-angular": "0.1000.4",
"#angular/animations": "^10.0.7",
"#angular/common": "^10.0.7",
"#angular/compiler": "^10.0.7",
"#angular/core": "^10.0.7",
"#angular/forms": "^10.0.7",
"#angular/platform-browser": "^10.0.7",
"#angular/platform-browser-dynamic": "^10.0.7",
"#angular/router": "^10.0.7",
"#ng-idle/core": "^8.0.0-beta.4",
"#ng-idle/keepalive": "^8.0.0-beta.4",
"#nguniversal/express-engine": "^9.1.1",
"#nguniversal/module-map-ngfactory-loader": "^8.1.1",
"async-exit-hook": "^2.0.1",
"body-parser": "^1.18.3",
"cfenv": "^1.2.2",
"classlist.js": "^1.1.20150312",
"core-js": "^3.0.0",
"crypto-js": "3.1.9-1",
"d3": "^5.9.2",
"dotenv": "^8.1.0",
"eureka-js-client": "^4.4.2",
"file-saver": "^2.0.1",
"google-maps": "^4.3.2",
"healthcheck-ping": "^2.0.1",
"hystrixjs": "^0.2.0",
"jsnlog": "^2.29.0",
"json-logic-js": "^1.2.2",
"jsrsasign": "^8.0.20",
"memory-cache": "^0.2.0",
"morgan": "^1.9.1",
"ng2-cookies": "^1.0.12",
"ng2-slimscroll": "^2.0.1",
"ngx-ui-loader": "^9.1.1",
"ngx-webstorage": "^5.0.0",
"node-fetch": "^2.3.0",
"preboot": "^7.0.0",
"reflect-metadata": "^0.1.13",
"source-map-support": "^0.5.11",
"string-to-json": "^0.1.0",
"text-mask-addons": "^3.8.0",
"tslib": "^2.0.0",
"web-animations-js": "^2.3.2",
"weighted-round-robin": "^2.0.2",
"zone.js": "~0.10.3"
},
"devDependencies": {
"#angular/cli": "^10.0.4",
"#angular/compiler-cli": "^10.0.7",
"#angular/language-service": "^10.0.7",
"#types/express": "^4.17.7",
"#types/google-maps": "^3.2.2",
"#types/jasmine": "^3.5.11",
"#types/jasminewd2": "^2.0.6",
"#types/node": "^14.0.23",
"#types/node-fetch": "^2.5.5",
"browserstack-local": "^1.3.7",
"codelyzer": "^6.0.0",
"cpx": "^1.5.0",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~3.3.0",
"karma-jasmine-html-reporter": "^1.5.0",
"ng-packagr": "^10.0.0",
"npm-run-all": "^4.1.5",
"protractor": "~7.0.0",
"rimraf": "^3.0.0",
"ts-loader": "^7.0.5",
"ts-node": "^8.10.2",
"tslint": "~6.1.0",
"typescript": "3.9.7",
"webpack-bundle-analyzer": "^3.1.0",
"webpack-cli": "^3.3.12",
"webpack-node-externals": "^1.7.2"
}
It seems there is an issue in #angular/compiler 10.1.1.
This isn't a solution for that problem, but I was able to workaround the issue by downgrading both #angular/compiler and #angular/compile-cli to 10.0. An update to package.json alone wasn't sufficient. I also needed to clean up node_modules to revert the code.
The steps I took that resulted in a successful build...
Update package.json
"dependencies": {
...
"#angular/compiler": "~10.0.3",
...
},
"devDependencies": {
...
"#angular/compiler-cli": "~10.0.3",
...
}
Note the tilde (~) instead of caret (^) above so that npm doesn't automatically give you 10.1.1.
rm -rf node_modules
npm update && ng build --prod
Sometimes it occurs due to extra or less closing tag in HTML.
Check your latest changes in html template file.

Error:- #ng-bootstrap\ng-bootstrap\datepicker\datepicker-navigation.d.ts.NgbDatepickerNavigation.html

I am getting error as I have updated to angular7?
Package.json
"dependencies": {
"#angular/animations": "^7.0.3",
"#angular/common": "^7.0.3",
"#angular/compiler": "^7.0.3",
"#angular/core": "^7.0.3",
"#angular/forms": "^7.0.3",
"#angular/http": "^7.0.3",
"#angular/platform-browser": "^7.0.3",
"#angular/platform-browser-dynamic": "^7.0.3",
"#angular/platform-server": "^7.0.3",
"#angular/router": "^7.0.3",
"#ng-bootstrap/ng-bootstrap": "^1.0.0-beta.9",
"#types/lodash": "^4.14.116",
"bootstrap": "^4.1.3",
"core-js": "^2.5.7",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"ng-connection-service": "^1.0.4",
"ngx-perfect-scrollbar": "^6.3.1",
"ngx-toastr": "^9.1.0",
"ngx-ui-switch": "^1.6.0",
"rxjs": "^6.3.3",
"rxjs-compat": "^6.3.3",
"web-animations-js": "2.3.1",
"zone.js": "^0.8.26"
},
"devDependencies": {
"#angular-devkit/build-angular": "^0.10.5",
"#angular/cdk": "^6.4.7",
"#angular/cli": "^7.0.5",
"#angular/compiler-cli": "^7.0.3",
"#angular/language-service": "^7.0.3",
"#angular/material": "^6.4.7",
"#types/jasmine": "^2.8.11",
"#types/jasminewd2": "~2.0.2",
"#types/node": "^10.12.6",
"codelyzer": "^4.5.0",
"jasmine-core": "^3.3.0",
"jasmine-spec-reporter": "^4.2.1",
"karma": "^3.1.1",
"karma-chrome-launcher": "^2.2.0",
"karma-cli": "^1.0.1",
"karma-coverage-istanbul-reporter": "^1.4.3",
"karma-jasmine": "^1.1.2",
"karma-jasmine-html-reporter": "^1.4.0",
"node-sass": "^4.9.3",
"protractor": "^5.4.1",
"rxjs-tslint": "^0.1.5",
"ts-node": "~4.1.0",
"tslint": "^5.11.0",
"typescript": "^3.1.6",
"webpack": "^4.20.2"
}
}
Above error occuring while I am running command:-
ng build --configuration=qa
How to solve this issue while using ng build --configuration=qa ?
This error occuring when running ng build --configuration=qa ?
Error:-
ERROR in
node_modules\#ng-bootstrap\ng-bootstrap\datepicker\datepicker-navigation.d.ts.NgbDatepickerNavigation.html(3,67):
: An expression of type 'void' cannot be tested for truthiness
I updated the '#ng-bootstrap/ng-bootstrap' package to version 4 and it solved the problem.
try this npm install --save #ng-bootstrap/ng-bootstrap#latest

can't bind to 'ngOutletContext' since it isn't a known property of 'ng-template' angular 5

I've been told to switch from ngOutletContext to ngTemplateOutletContext for my upgrade from angular 4.4 to 5.2.
What is bugging me is that I do not have a single directive ngOutletContext in any of my tags.
For example, all of my ng-template tags look like this:
<ng-template tabHeading>
or
<ng-template ngFor let-breadcrumb [ngForOf]="breadcrumbs" let-last = last>
or
<ng-template ngbTabContent>
I'm guessing it is a problem with some of the dependencies that I have installed?
Here is the list, would appreciate a second pair of eyes on this:
"dependencies": {
"#angular/animations": "^5.2.9",
"#angular/common": "^5.2.9",
"#angular/compiler": "^5.2.9",
"#angular/core": "^5.2.9",
"#angular/forms": "^5.2.9",
"#angular/http": "^5.2.9",
"#angular/platform-browser": "^5.2.9",
"#angular/platform-browser-dynamic": "^5.2.9",
"#angular/platform-server": "^5.2.9",
"#angular/router": "^5.2.9",
"#ng-bootstrap/ng-bootstrap": "1.0.0-beta.5",
"#swimlane/ngx-charts": "^6.1.0",
"angular2-jwt": "^0.2.3",
"angular2-text-mask": "^8.0.0",
"chart.js": "^2.7.2",
"classlist.js": "^1.1.20150312",
"core-js": "2.5.1",
"d3": "^4.11.0",
"font-awesome": "4.7.0",
"html2canvas": "^0.5.0-beta4",
"jspdf": "^1.3.5",
"moment": "^2.19.3",
"ng-bootstrap": "1.6.3",
"ng-select": "1.0.0-beta.6",
"ng2-charts": "^1.6.0",
"ngx-bootstrap": "2.0.0-beta.8",
"ngx-progressbar": "~2.0.8",
"ngx-toastr": "^6.3.0",
"pdfjs-dist": "^2.0.395",
"rxjs": "^5.5.8",
"simple-line-icons": "2.4.1",
"text-mask-addons": "^3.7.0",
"ts-helpers": "1.1.2",
"web-animations-js": "^2.3.1",
"zone.js": "0.8.14"
},
"devDependencies": {
"#angular/cli": "1.7.3",
"#angular/compiler-cli": "^5.2.9",
"#types/jasmine": "2.5.43",
"#types/jasminewd2": "^2.0.3",
"#types/jspdf": "^1.1.31",
"#types/mongodb": "^2.2.11",
"#types/mongoose": "^4.7.23",
"#types/node": "7.0.5",
"#types/rx": "^4.1.1",
"codelyzer": "4.0.0",
"jasmine": "^3.1.0",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "3.2.0",
"karma": "1.5.0",
"karma-chrome-launcher": "2.0.0",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.0.0",
"karma-jasmine": "1.1.0",
"karma-jasmine-html-reporter": "0.2.2",
"protractor": "5.1.1",
"snyk": "^1.70.2",
"ts-node": "3.3.0",
"tslint": "5.9.1",
"typescript": "^2.4.2"
}
Try searching on your node_module folder