Angular2 : After npm update, my app is broken - node.js

I have a problem with my angular 2/cli project.
I have done an update of my npm packages but after that, when I'm using ng serve, I get theses errors :
Time: 12752ms
chunk {0} main.bundle.js, main.bundle.map (main) 45.3 kB {2} [initial] [rendered]
chunk {1} styles.bundle.css, styles.bundle.map, styles.bundle.map (styles) 20.6 kB {3} [initial] [rendered]
chunk {2} vendor.bundle.js, vendor.bundle.map (vendor) 3.52 MB [initial] [rendered]
chunk {3} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]
ERROR in AppModule is not an NgModule
ERROR in ./src/app/shared/guards/unauth-guard.ts
Module build failed: Error: /Users/nicolas/Desktop/Dilit/seller-app/src/app/shared/guards/unauth-guard.ts (16,8): Property 'take' does not exist on type 'AngularFireAuth'.)
at _checkDiagnostics (/Users/nicolas/Desktop/Dilit/seller-app/node_modules/#ngtools/webpack/src/loader.js:116:15)
at /Users/nicolas/Desktop/Dilit/seller-app/node_modules/#ngtools/webpack/src/loader.js:141:17
# ./src/app/app.module.ts 23:0-59
# ./src/app/index.ts
# ./src/main.ts
# multi main
ERROR in ./src/app/shared/guards/auth-guard.ts
Module build failed: Error: /Users/nicolas/Desktop/Dilit/seller-app/src/app/shared/guards/auth-guard.ts (17,8): Property 'take' does not exist on type 'AngularFireAuth'.)
at _checkDiagnostics (/Users/nicolas/Desktop/Dilit/seller-app/node_modules/#ngtools/webpack/src/loader.js:116:15)
at /Users/nicolas/Desktop/Dilit/seller-app/node_modules/#ngtools/webpack/src/loader.js:141:17
# ./src/app/app.module.ts 24:0-55
# ./src/app/index.ts
# ./src/main.ts
# multi main
ERROR in ./src/app/application/application.component.ts
Module not found: Error: Can't resolve 'application.frame.component.html' in '/Users/nicolas/Desktop/Dilit/seller-app/src/app/application'
# ./src/app/application/application.component.ts 39:18-61
# ./src/app/app.module.ts
# ./src/app/index.ts
# ./src/main.ts
# multi main
ERROR in ./src/app/application/dashboard/dashboard.component.ts
Module not found: Error: Can't resolve 'dashboard.component.html' in '/Users/nicolas/Desktop/Dilit/seller-app/src/app/application/dashboard'
# ./src/app/application/dashboard/dashboard.component.ts 63:18-53
# ./src/app/app.module.ts
# ./src/app/index.ts
# ./src/main.ts
# multi main
ERROR in ./src/app/application/dashboard/dashboard.component.ts
Module not found: Error: Can't resolve 'dashboard.component.scss' in '/Users/nicolas/Desktop/Dilit/seller-app/src/app/application/dashboard'
# ./src/app/application/dashboard/dashboard.component.ts 64:17-52
# ./src/app/app.module.ts
# ./src/app/index.ts
# ./src/main.ts
# multi main
ERROR in ./src/app/application/campaign/campaign.component.ts
Module not found: Error: Can't resolve 'campaign.component.html' in '/Users/nicolas/Desktop/Dilit/seller-app/src/app/application/campaign'
# ./src/app/application/campaign/campaign.component.ts 81:18-52
# ./src/app/app.module.ts
# ./src/app/index.ts
# ./src/main.ts
# multi main
ERROR in ./src/app/application/campaign/campaign.component.ts
Module not found: Error: Can't resolve 'campaign.component.scss' in '/Users/nicolas/Desktop/Dilit/seller-app/src/app/application/campaign'
# ./src/app/application/campaign/campaign.component.ts 82:17-51
# ./src/app/app.module.ts
# ./src/app/index.ts
# ./src/main.ts
# multi main
webpack: bundle is now VALID.
Even if I return to my old package.json config, I can't build my project.
These is my package.json :
{
"name": "seller-app",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng serve",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"#angular/common": "2.4.1",
"#angular/compiler": "2.4.1",
"#angular/core": "2.4.1",
"#angular/forms": "2.4.1",
"#angular/http": "2.4.1",
"#angular/platform-browser": "2.4.1",
"#angular/platform-browser-dynamic": "2.4.1",
"#angular/router": "3.4.1",
"#types/node": "^6.0.53",
"angularfire2": "^2.0.0-beta.7-pre",
"core-js": "^2.4.1",
"firebase": "^3.6.4",
"ng2-img-cropper": "^0.7.6",
"ng2-toastr": "^1.3.2",
"rxjs": "5.0.2",
"ts-helpers": "^1.1.1",
"zone.js": "^0.7.4"
},
"devDependencies": {
"#angular/compiler-cli": "2.4.1",
"#types/jasmine": "2.5.40",
"#types/node": "^6.0.42",
"angular-cli": "1.0.0-beta.24",
"codelyzer": "~2.0.0-beta.4",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "2.7.0",
"karma": "1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.4.0",
"protractor": "4.0.14",
"ts-node": "2.0.0",
"tslint": "4.2.0",
"typescript": "~2.1.4",
"webdriver-manager": "11.1.0"
}
}
Thanks for your help

I got the same error when upgrading TypeScript to 2.1.4. The error exists when downgrading to TypeScript 2.1.1. The error disappears when downgrading to TypeScript 2.0.8.

Related

SassError: Undefined variable. Failing dependencies

I have a CI/CD pipeline for an Angular project which yesterday worked fine, but today the same code is returning several errors on the build:
./src/styles.scss.webpack[javascript/auto]!=!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].rules[0].oneOf[0].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[6].rules[0].oneOf[0].use[2]!./node_modules/resolve-url-loader/index.js??ruleSet[1].rules[6].rules[1].use[0]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[6].rules[1].use[1]!./src/styles.scss
- Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): SassError: Undefined variable.
╷ 142 │ values: $utilities-border-colors
│ ^^^^^^^^^^^^^^^^^^^^^^^^
╵ node_modules\bootstrap\scss\_utilities.scss 142:15 #import src\styles.scss 7:9 root stylesheet
./src/styles.scss - Error: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
HookWebpackError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined variable.
╷
142 │ values: $utilities-border-colors
│ ^^^^^^^^^^^^^^^^^^^^^^^^
╵
node_modules\bootstrap\scss\_utilities.scss 142:15 #import
src\styles.scss 7:9 root stylesheet
at tryRunOrWebpackError (C:\User\user\project\node_modules\webpack\lib\HookWebpackError.js:88:9)
at __webpack_require_module__ (C:\User\user\project\node_modules\webpack\lib\Compilation.js:4979:12)
at __webpack_require__ (C:\User\user\project\node_modules\webpack\lib\Compilation.js:4936:18)
at C:\User\user\project\node_modules\webpack\lib\Compilation.js:5007:20
at symbolIterator (C:\User\user\project\node_modules\neo-async\async.js:3485:9)
at done (C:\User\user\project\node_modules\neo-async\async.js:3527:9)
at Hook.eval [as callAsync] (eval at create (C:\User\user\project\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:\User\user\project\node_modules\tapable\lib\Hook.js:18:14)
at C:\User\user\project\node_modules\webpack\lib\Compilation.js:4914:43
at symbolIterator (C:\User\user\project\node_modules\neo-async\async.js:3482:9)
at timesSync (C:\User\user\project\node_modules\neo-async\async.js:2297:7)
at Object.eachLimit (C:\User\user\project\node_modules\neo-async\async.js:3463:5)
at C:\User\user\project\node_modules\webpack\lib\Compilation.js:4879:16
at symbolIterator (C:\User\user\project\node_modules\neo-async\async.js:3485:9)
at timesSync (C:\User\user\project\node_modules\neo-async\async.js:2297:7)
at Object.eachLimit (C:\User\user\project\node_modules\neo-async\async.js:3463:5)
-- inner error --
Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined variable.
╷
142 │ values: $utilities-border-colors
│ ^^^^^^^^^^^^^^^^^^^^^^^^
╵
node_modules\bootstrap\scss\_utilities.scss 142:15 #import
src\styles.scss 7:9 root stylesheet
at Object.<anonymous> (C:\User\user\project\node_modules\css-loader\dist\cjs.js??ruleSet[1].rules[6].rules[0].oneOf[0].use[1]!C:\User\user\project\node_modules\postcss-loader\dist\cjs.js??ruleSet[1].rules[6].rules[0].oneOf[0].use[2]!C:\User\user\project\node_modules\resolve-url-loader\index.js??ruleSet[1].rules[6].rules[1].use[0]!C:\User\user\project\node_modules\sass-loader\dist\cjs.js??ruleSet[1].rules[6].rules[1].use[1]!C:\User\user\project\src\styles.scss:1:7)
at C:\User\user\project\node_modules\webpack\lib\javascript\JavascriptModulesPlugin.js:432:11
at Hook.eval [as call] (eval at create (C:\User\user\project\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:7:1)
at Hook.CALL_DELEGATE [as _call] (C:\User\user\project\node_modules\tapable\lib\Hook.js:14:14)
at C:\User\user\project\node_modules\webpack\lib\Compilation.js:4981:39
at tryRunOrWebpackError (C:\User\user\project\node_modules\webpack\lib\HookWebpackError.js:83:7)
at __webpack_require_module__ (C:\User\user\project\node_modules\webpack\lib\Compilation.js:4979:12)
at __webpack_require__ (C:\User\user\project\node_modules\webpack\lib\Compilation.js:4936:18)
at C:\User\user\project\node_modules\webpack\lib\Compilation.js:5007:20
at symbolIterator (C:\User\user\project\node_modules\neo-async\async.js:3485:9)
at done (C:\User\user\project\node_modules\neo-async\async.js:3527:9)
at Hook.eval [as callAsync] (eval at create (C:\User\user\project\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:\User\user\project\node_modules\tapable\lib\Hook.js:18:14)
at C:\User\user\project\node_modules\webpack\lib\Compilation.js:4914:43
at symbolIterator (C:\User\user\project\node_modules\neo-async\async.js:3482:9)
at timesSync (C:\User\user\project\node_modules\neo-async\async.js:2297:7)
Generated code for C:\User\user\project\node_modules\css-loader\dist\cjs.js??ruleSet[1].rules[6].rules[0].oneOf[0].use[1]!C:\User\user\project\node_modules\postcss-loader\dist\cjs.js??ruleSet[1].rules[6].rules[0].oneOf[0].use[2]!C:\User\user\project\node_modules\resolve-url-loader\index.js??ruleSet[1].rules[6].rules[1].use[0]!C:\User\user\project\node_modules\sass-loader\dist\cjs.js??ruleSet[1].rules[6].rules[1].use[1]!C:\User\user\project\src\styles.scss
1 | throw new Error("Module build failed (from ./node_modules/sass-loader/dist/cjs.js):\nSassError: Undefined variable.\n ╷\n142 │ values: $utilities-border-colors\n │ ^^^^^^^^^^^^^^^^^^^^^^^^\n ╵\n node_modules\\bootstrap\\scss\\_utilities.scss 142:15 #import\n src\\styles.scss 7:9 root stylesheet");
I could reproduce it in local when I deleted the package-lock.json and generated one new.
This is my package.json
{
"name": "app-name",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --host 0.0.0.0",
"dev": "ng serve --host 0.0.0.0 -c dev",
"debug": "ng serve --host 0.0.0.0 -c debug",
"serve:es5": "ng serve --configuration es5 --host 0.0.0.0",
"build:dev": "ng build --configuration=dev",
"build:preprod": "ng build --configuration=preprod",
"build:prod": "ng build --configuration=production",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular-architects/ddd": "^2.0.0",
"#angular/animations": "^13.2.2",
"#angular/cdk": "^13.2.2",
"#angular/common": "^13.2.2",
"#angular/compiler": "^13.2.2",
"#angular/core": "^13.2.2",
"#angular/forms": "^13.2.2",
"#angular/localize": "^13.2.2",
"#angular/material": "^13.2.2",
"#angular/material-moment-adapter": "^13.2.2",
"#angular/platform-browser": "^13.2.2",
"#angular/platform-browser-dynamic": "^13.2.2",
"#angular/router": "^13.2.2",
"#babel/runtime": "^7.16.0",
"#fortawesome/angular-fontawesome": "^0.10.0",
"#fortawesome/fontawesome-svg-core": "^1.3.0",
"#fortawesome/free-solid-svg-icons": "^6.0.0",
"#microsoft/applicationinsights-web": "^2.7.1",
"#ng-bootstrap/ng-bootstrap": "^12.0.0-beta.4",
"#ngrx/effects": "^13.0.2",
"#ngrx/store": "^13.0.2",
"#ngrx/store-devtools": "^13.0.2",
"#ngx-translate/core": "^10.0.2",
"#ngx-translate/http-loader": "^3.0.1",
"#popperjs/core": "^2.10.2",
"#types/bootstrap": "^5.1.6",
"#types/file-saver": "^2.0.3",
"#types/jquery": "^3.5.8",
"amplitude-js": "^8.17.0",
"bootstrap": "^5.1.3",
"bootstrap-icons": "^1.7.0",
"chart.js": "^2.9.4",
"classlist.js": "^1.1.20150312",
"core-js": "^2.6.12",
"dropzone": "^6.0.0-beta.2",
"file-saver": "^2.0.5",
"font-awesome": "^4.7.0",
"intl-tel-input": "^17.0.13",
"jquery": "^3.6.0",
"moment": "^2.29.1",
"ng-lottie": "git+https://github.com/Jrbebel/ng-lottie.git",
"ng2-nouislider": "^1.8.3",
"ngx-papaparse": "^5.0.0",
"nouislider": "^12.0.0",
"npm": "^8.11.0",
"poeditor-ci": "^1.15.0",
"pretty-checkbox": "^3.0.3",
"rxjs": "^6.6.7",
"tslib": "^2.0.0",
"uuid": "^3.4.0",
"xlsx": "^0.17.4",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "~13.1.3",
"#angular-eslint/builder": "^12.0.0",
"#angular-eslint/eslint-plugin": "^12.0.0",
"#angular-eslint/eslint-plugin-template": "^12.0.0",
"#angular-eslint/schematics": "^13.1.0",
"#angular-eslint/template-parser": "^12.0.0",
"#angular/cli": "^13.2.3",
"#angular/compiler-cli": "^13.0.0",
"#angular/language-service": "^13.2.2",
"#types/chart.js": "^2.9.34",
"#types/node": "^12.20.45",
"#typescript-eslint/eslint-plugin": "4.28.2",
"#typescript-eslint/parser": "4.28.2",
"codelyzer": "^6.0.0",
"eslint": "^7.26.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsdoc": "30.7.6",
"eslint-plugin-prefer-arrow": "1.2.2",
"protractor": "^7.0.0",
"ts-node": "~7.0.0",
"tslint": "~6.1.0",
"typescript": "4.5.5"
}
}
I don't even use the $utilities-border-colors variables and aren't present in my code.
My node version is 16.16
My npm version is 8.14.0
Could be that I have to update any of the dependencies, and why if I didn't change anything, it just doesn't work now?
Thanks in advance.
As it's said in the comments by Krenom, removing the ^ from the Bootstrap import fixed the issue.
Thanks for the responses and all the info.
Bootstrap v5.2 introduced a new file called _maps.scss. You must add it to your main Sass file.
Load your bootstrap modules in this order:
#import "~bootstrap/scss/functions";
#import "~bootstrap/scss/variables";
#import "~bootstrap/scss/maps"; // **Newly added!**
#import "~bootstrap/scss/mixins";
#import "~bootstrap/scss/utilities";
#import "~bootstrap/scss/helpers";
#import "~bootstrap/scss/utilities/api";
The problem should be fixed now.
I'll be greedy and slap it as an answer so that it can be accepted and one is available for those that follow.
The dangers of using ^ style versioning. Any one of those things might have been installed as a slightly different version that now breaks something. Bootstrap, at a guess given the error message and a new version was pushed out yesterday according to npm. Start with that and lock it down to a specific version (maybe just 5.1.3 for now, so just remove the ^) and see if that builds again.
You are kind of right, it's a bit strange that it happened without changing anything.
The reason of that is that yesterday a commit
took place on the main branch of twbs/
bootstrap, the v5.2.0 update.
The easy way to revert the changes is to follow #krenom advice.
Additionally, if you mind to install the v5.2.0 update please make sure to be advised about the new Sass file _maps.scss that comes with several Sasss maps from _variables.scss.
You can read more here.
There is a new _map.scss in v5.2.0. Don't have the details regarding your Webpack build but you probably just need to #import "~bootstrap/scss/maps"; (that's where $utilities-border-colors is defined) before #import "~bootstrap/scss/utilities";.
You can try to remove your node_modules directory and package-lock.json file. Then npm install.
And check if the error still append.
As #krenom say, it coulb be highter boostrap version dowloaded during the build. You can remove the ^ before the version in your package.json and reinstall your node_modules.
You need to define other 'sass' modules for Boostrap.
If you define as below, the problem is solved.
// Bootstrap initializaton
#import '~bootstrap/scss/functions';
#import '~bootstrap/scss/variables';
#import '~bootstrap/scss/mixins';
#import "~bootstrap/scss/maps";
#import "~bootstrap/scss/utilities";
#import "~bootstrap/scss/helpers";
#import "~bootstrap/scss/utilities/api";

Existing Angular 7.2 Application Fails To Build With Typescript Errors

I am migrating an Angular 7.2.0 application to a new Linux server, and I am unable to get the ng build command to run. Here is the package.json:
{
"name": "<app name>",
"version": "1.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#agm/core": "^1.0.0-beta.5",
"#angular/animations": "~7.2.0",
"#angular/common": "~7.2.0",
"#angular/compiler": "~7.2.0",
"#angular/core": "~7.2.0",
"#angular/forms": "~7.2.0",
"#angular/http": "^7.2.2",
"#angular/platform-browser": "~7.2.0",
"#angular/platform-browser-dynamic": "~7.2.0",
"#angular/router": "~7.2.0",
"#mdi/font": "^3.3.92",
"#ng-select/ng-select": "^2.15.3",
"angular-confirmation-popover": "^4.2.0",
"angular-resize-event": "^1.0.0",
"angular2-ladda": "^2.0.0",
"awesome-bootstrap-checkbox": "^1.0.1",
"bootstrap": "^4.2.1",
"core-js": "^2.5.4",
"datatables.net-bs4": "^1.10.19",
"dripicons": "^2.0.0",
"font-awesome": "^4.7.0",
"highcharts": "^7.0.3",
"highcharts-angular": "^2.4.0",
"linkifyjs": "^2.1.9",
"metismenujs": "^1.0.3",
"moment": "^2.24.0",
"moment-timezone": "^0.5.23",
"ng-block-ui": "^2.1.1",
"ng2-daterangepicker": "^2.0.12",
"ng2-search-filter": "^0.5.1",
"ngx-bootstrap": "^3.3.0",
"ngx-mask": "^7.3.6",
"ngx-perfect-scrollbar": "^7.2.0",
"ngx-toastr": "^9.1.1",
"ngx-uploader": "^7.1.0",
"rxjs": "~6.3.3",
"simple-line-icons": "^2.4.1",
"spinkit": "^1.2.5",
"tslib": "^1.9.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"#angular-devkit/build-angular": "~0.12.0",
"#angular/cli": "~7.2.3",
"#angular/compiler-cli": "~7.2.0",
"#angular/language-service": "~7.2.0",
"#types/jasmine": "~2.8.8",
"#types/jasminewd2": "~2.0.3",
"#types/lodash": "^4.14.122",
"#types/moment-timezone": "^0.5.10",
"#types/node": "~8.9.4",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.1.1",
"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",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.2.2"
}
}
Here is ng --version:
Angular CLI: 7.2.4
Node: 8.17.0
OS: linux x64
Angular: 7.2.16
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
#angular-devkit/architect 0.12.4
#angular-devkit/build-angular 0.12.4
#angular-devkit/build-optimizer 0.12.4
#angular-devkit/build-webpack 0.12.4
#angular-devkit/core 7.2.4
#angular-devkit/schematics 7.2.4
#angular/cli 7.2.4
#ngtools/webpack 7.2.4
#schematics/angular 7.2.4
#schematics/update 0.12.4
rxjs 6.3.3
typescript 3.2.4
webpack 4.28.4
And here is the error from ng build:
Warning: 4 repetitive deprecation warnings omitted.
Date: 2022-05-25T15:12:59.684Z
Hash: c3e6d9d0970d51906cb6
Time: 10245ms
chunk {main} main.js, main.js.map (main) 626 bytes [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 93.2 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 2.2 MB [initial] [rendered]
ERROR in src/app/admin/probe/sensor-chart/sensor-chart-abstract.class.ts(260,51): error TS2345: Argument of type '{ point: Point; }' is not assignable to parameter of type 'string | SeriesClickEventObject'.
Type '{ point: Point; }' is missing the following properties from type 'SeriesClickEventObject': bubbles, cancelBubble, cancelable, composed, and 18 more.
src/app/admin/probe/sensor-chart/sensor-chart-abstract.class.ts(283,37): error TS2345: Argument of type '{ id: string; draggable: string; labels: any[]; labelOptions: { style: { cursor: string; }; verticalAlign: string; y: number; }; events: { click: (event: any) => void; }; }' is not assignable to parameter of type 'AnnotationsOptions'.
Types of property 'draggable' are incompatible.
Type 'string' is not assignable to type '"" | "y" | "x" | "xy"'.
src/app/admin/report/probe-selector/probe-selector.component.ts(45,22): error TS2345: Argument of type '{ _selected: boolean; }' is not assignable to parameter of type 'ListIterateeCustom<Probe, boolean>'.
Object literal may only specify known properties, and '_selected' does not exist in type '[string | number | symbol, any] | ListIterator<Probe, boolean> | PartialShallow<Probe>'.
src/app/app.component.ts(7,27): error TS2307: Cannot find module '../environments/environment'.
src/app/app.component.ts(29,22): error TS2322: Type '{ useUTC: boolean; }' is not assignable to type 'GlobalOptions'.
Object literal may only specify known properties, and 'useUTC' does not exist in type 'GlobalOptions'.
src/app/app.module.ts(23,27): error TS2307: Cannot find module '../environments/environment'.
src/main.ts(5,29): error TS2307: Cannot find module './environments/environment'.
This application has been built before (and no code changes since), so it appears that I am running into a Node/NPM/node-sass versioning issue.
I have tried Node 8, Node 12, and Node 16 with various versions of node-sass and sass.
What should I look at considering this type of Typescript error in order to build this Angular 7 project?
Thanks!

How to fix export 'NotificationKind' was not found in 'rxjs' error

NotificationKind has been deprecated here but when building an angular 8 app it throws the following error:
ng build
Date: 2019-06-08T16:44:40.118Z
Hash: 7f30f6f31d45ce95291b
Time: 12019ms
chunk {main} main-es5.js, main-es5.js.map (main) 72.2 kB [initial] [rendered]
chunk {polyfills} polyfills-es5.js, polyfills-es5.js.map (polyfills) 662 kB [initial] [rendered]
chunk {runtime} runtime-es5.js, runtime-es5.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {styles} styles-es5.js, styles-es5.js.map (styles) 1.45 MB [initial] [rendered]
chunk {vendor} vendor-es5.js, vendor-es5.js.map (vendor) 3.93 MB [initial] [rendered]
ERROR in /var/app/node_modules/#ngrx/effects/fesm5/effects.js 401:33-49
"export 'NotificationKind' was not found in 'rxjs'
ERROR in /var/app/node_modules/#ngrx/effects/fesm5/effects.js 403:56-72
"export 'NotificationKind' was not found in 'rxjs'
ERROR in /var/app/node_modules/#ngrx/effects/fesm5/effects.js 404:33-49
"export 'NotificationKind' was not found in 'rxjs'
ERROR in /var/app/node_modules/#ngrx/effects/fesm5/effects.js 407:55-71
"export 'NotificationKind' was not found in 'rxjs'
{
"name": "#spotacard/app",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "nx lint && ng lint",
"e2e": "ng e2e",
"affected:apps": "nx affected:apps",
"affected:libs": "nx affected:libs",
"affected:build": "nx affected:build",
"affected:e2e": "nx affected:e2e",
"affected:test": "nx affected:test",
"affected:lint": "nx affected:lint",
"affected:dep-graph": "nx affected:dep-graph",
"affected": "nx affected",
"format": "nx format:write",
"format:write": "nx format:write",
"format:check": "nx format:check",
"update": "ng update #nrwl/workspace",
"update:check": "ng update",
"workspace-schematic": "nx workspace-schematic",
"dep-graph": "nx dep-graph",
"help": "nx help"
},
"private": true,
"dependencies": {
"#angular/animations": "^8.0.0",
"#angular/common": "^8.0.0",
"#angular/compiler": "^8.0.0",
"#angular/core": "^8.0.0",
"#angular/forms": "^8.0.0",
"#angular/platform-browser": "^8.0.0",
"#angular/platform-browser-dynamic": "^8.0.0",
"#angular/router": "^8.0.0",
"#ngrx/effects": "^8.0.0",
"#ngrx/router-store": "^8.0.0",
"#ngrx/store": "^8.0.0",
"#ngrx/store-devtools": "^8.0.0",
"#nrwl/angular": "^8.0.1",
"#nrwl/nx": "^7.8.6",
"bootstrap": "^4.3.1",
"bootswatch": "^4.3.1",
"core-js": "^2.5.4",
"ngrx-store-freeze": "^0.2.4",
"rxjs": "~6.3.3",
"rxjs-compat": "^6.5.2",
"zone.js": "^0.9.1"
},
"devDependencies": {
"jest-preset-angular": "7.0.0",
"#angular/compiler-cli": "^8.0.0",
"#angular/language-service": "^8.0.0",
"#angular-devkit/build-angular": "^0.800.0",
"codelyzer": "~5.0.1",
"cypress": "3.1.0",
"#types/jquery": "3.3.6",
"#nrwl/cypress": "8.0.1",
"#nrwl/jest": "8.0.1",
"jest": "24.1.0",
"#types/jest": "24.0.9",
"ts-jest": "24.0.0",
"#nrwl/workspace": "8.0.1",
"#types/node": "~8.9.4",
"dotenv": "6.2.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.4.5",
"prettier": "1.16.4",
"#angular/cli": "8.0.0"
}
}
Does anyone know how to fix this problem?
Have you tried upgrading RxJS?
V8 has the minimum version requirements:
Angular version 8.x
Angular CLI version 8.0.2
TypeScript version 3.4.x
RxJS version 6.5.x
https://ngrx.io/guide/migration/v8
Update 2019-06-10:
NgRx v8.0.1 has a dep to RxJS 6.4 instead of 6.5
I encountered a similar issue. I was able to solve it by running:
npm install rxjs#6.5.0

Can't resolve rxjs/*** on angular 5 project

I can't run my angular app on amazon ec2. When I execute ng serve or ng serve -c stage with environment.stage.ts configuration, i'm getting errors as shown on the screenshot below. The error does not appear when run locally on my pc and project is compiled without errors.
The version of rxjs is 5.5.5.
Angular, angular-cli and node version also below.
ERROR in ./node_modules/#angular/router/esm5/router.js
Module not found: Error: Can't resolve 'rxjs/BehaviorSubject' in '/home/ubuntu/b2s_dev/b2s_v2_web/node_modules/#angular/router/esm5'
ERROR in ./node_modules/#agm/core/services/google-maps-api-wrapper.js
Module not found: Error: Can't resolve 'rxjs/Observable' in '/home/ubuntu/b2s_dev/b2s_v2_web/node_modules/#agm/core/services'
ERROR in ./node_modules/#agm/core/services/managers/data-layer-manager.js
Module not found: Error: Can't resolve 'rxjs/Observable' in '/home/ubuntu/b2s_dev/b2s_v2_web/node_modules/#agm/core/services/managers'
ERROR in ./node_modules/#agm/core/services/managers/marker-manager.js
Module not found: Error: Can't resolve 'rxjs/Observable' in '/home/ubuntu/b2s_dev/b2s_v2_web/node_modules/#agm/core/services/managers'
ERROR in ./node_modules/#agm/core/services/managers/info-window-manager.js
Module not found: Error: Can't resolve 'rxjs/Observable' in '/home/ubuntu/b2s_dev/b2s_v2_web/node_modules/#agm/core/services/managers'
ERROR in ./node_modules/#agm/core/services/managers/polyline-manager.js
Module not found: Error: Can't resolve 'rxjs/Observable' in '/home/ubuntu/b2s_dev/b2s_v2_web/node_modules/#agm/core/services/managers'
ERROR in ./node_modules/#agm/core/services/managers/circle-manager.js
Module not found: Error: Can't resolve 'rxjs/Observable' in '/home/ubuntu/b2s_dev/b2s_v2_web/node_modules/#agm/core/services/managers'
ERROR in ./node_modules/#agm/core/services/managers/kml-layer-manager.js
Module not found: Error: Can't resolve 'rxjs/Observable' in '/home/ubuntu/b2s_dev/b2s_v2_web/node_modules/#agm/core/services/managers'
ERROR in ./node_modules/#agm/core/services/managers/polygon-manager.js
Module not found: Error: Can't resolve 'rxjs/Observable' in '/home/ubuntu/b2s_dev/b2s_v2_web/node_modules/#agm/core/services/managers'
ERROR in ./node_modules/#angular/core/esm5/core.js
Module not found: Error: Can't resolve 'rxjs/Observable' in '/home/ubuntu/b2s_dev/b2s_v2_web/node_modules/#angular/core/esm5'
ERROR in ./node_modules/#angular/http/esm5/http.js
Module not found: Error: Can't resolve 'rxjs/Observable' in '/home/ubuntu/b2s_dev/b2s_v2_web/node_modules/#angular/http/esm5'
ℹ 「wdm」: Failed to compile.
BR,
try to import rxjs only without observables
{
"scripts": {
"ng": "ng",
"start": "ng serve",
"start-stage": "ng serve --env=stage",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"build:universal:prod": "ng build --prod && ng build --prod --app 1 --output-hashing=false && cpy ./server.js ./dist",
"serve:universal:prod": "npm run build:universal:prod && cd dist && node server",
"compile_#agm_core": "babel node_modules/#agm/core -d node_modules/#agm/core --presets es2015",
"postinstall": "npm run compile_#agm_core"
},
"private": true,
"dependencies": {
"#agm/core": "^1.0.0-beta.2",
"#angular/animations": "^5.0.0",
"#angular/common": "^5.0.0",
"#angular/compiler": "^5.0.0",
"#angular/core": "^5.0.0",
"#angular/forms": "^5.0.0",
"#angular/http": "^5.0.0",
"#angular/platform-browser": "^5.0.0",
"#angular/platform-browser-dynamic": "^5.0.0",
"#angular/platform-server": "^5.2.7",
"#angular/router": "^5.0.0",
"#nguniversal/express-engine": "^5.0.0-beta.6",
"babel-cli": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"core-js": "^2.4.1",
"moment": "^2.20.1",
"ng2-nouislider": "^1.7.7",
"ngx-disqus": "^2.3.7",
"nouislider": "^10.1.0",
"rxjs": "^5.5.5",
"zone.js": "^0.8.14"
},
"devDependencies": {
"#angular-devkit/build-angular": "^0.7.3",
"#angular/cli": "^6.1.3",
"#angular/compiler-cli": "^5.0.0",
"#angular/language-service": "^5.0.0",
"#types/googlemaps": "^3.30.4",
"#types/jasmine": "~2.5.53",
"#types/jasminewd2": "~2.0.2",
"#types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"cpy-cli": "^1.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"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": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "~2.4.2"
}
}
Use this command to install rxjs compact that will install the latest version of rxjs that is compatible with the Angular version that you are using.
npm install --save rxjs-compat

Critical dependency: the request of a dependency is an expression

Im trying to add gpio support to a project on my raspberry pi 3 model B but i keep encountering an error with bindings when i try to ng serve my app. This problem persists when I try to use any other gpio package.
WARNING in ./node_modules/rpi-gpio/node_modules/bindings/bindings.js
76:22-40 Critical dependency: the request of a dependency is an expression
...
...
...
# ./node_modules/rpi-gpio/node_modules/bindings/bindings.js
# ./node_modules/rpi-gpio/node_modules/epoll/epoll.js
# ./node_modules/rpi-gpio/rpi-gpio.js
# ./src/app/ui/...
# ./src/app/app.module.ts
# ./src/main.ts
# multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts
WARNING in ./node_modules/rpi-gpio/node_modules/bindings/bindings.js
76:43-53 Critical dependency: the request of a dependency is an expression
...
...
...
# ./node_modules/rpi-gpio/node_modules/bindings/bindings.js
# ./node_modules/rpi-gpio/node_modules/epoll/epoll.js
# ./node_modules/rpi-gpio/rpi-gpio.js
# ./src/app/ui/...
# ./src/app/app.module.ts
# ./src/main.ts
# multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts
I'm trying to use rpi-gpio (www.npmjs.com/package/rpi-gpio)(I installed all dependencies seperatly aswell).
Versions:
node: v9.3.0 (using nvm)
npm: 5.6.0
gcc: (Raspbian 6.3.0-18+rpi1) 6.3.0 20170516
Package.json:
{
"name": "pagode-shotterkas",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/animations": "^5.1.2",
"#angular/cdk": "^5.0.2",
"#angular/common": "^5.1.2",
"#angular/compiler": "^5.1.2",
"#angular/core": "^5.1.2",
"#angular/forms": "^5.1.2",
"#angular/http": "^5.1.2",
"#angular/material": "^5.0.2",
"#angular/platform-browser": "^5.1.2",
"#angular/platform-browser-dynamic": "^5.1.2",
"#angular/router": "^5.1.2",
"angular4-drag-drop": "^1.1.2",
"bindings": "^1.3.0",
"cordova-plugin-eid": "^1.0.0",
"core-js": "^2.5.3",
"epoll": "^1.0.2",
"hammerjs": "^2.0.8",
"nan": "^2.8.0",
"promise-polyfill": "^6.1.0",
"rpi-gpio": "^0.9.1",
"rxjs": "^5.5.6",
"zone.js": "^0.8.19"
},
"devDependencies": {
"#angular/cli": "^1.6.2",
"#angular/compiler-cli": "^5.1.2",
"#angular/language-service": "^5.1.2",
"#types/jasmine": "~2.5.53",
"#types/jasminewd2": "~2.0.2",
"#types/node": "^6.0.95",
"codelyzer": "~3.1.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.3.3",
"karma-jasmine": "^1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.3.2",
"typescript": "~2.5.0"
}
}

Resources