I've updated the dependencies and since then, I've got this error message when run ng serve:
An unhandled exception occurred: Cannot find module '#angular/compiler'
Require stack:
I've tried already this solutions: Cannot find module '#angular/compiler'
But didn't work for me.
Also deleted node_modules, checkout the project again.
Is there something wrong in my dependencies or what can I do to get it running again?
This is my package.json:
{
"name": "wichteli",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --host 0.0.0.0 --disable-host-check",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"test:ci": "ng test --browsers ChromeHeadlessCI --code-coverage true --watch false",
"e2e:ci": "ng e2e --protractor-config=e2e/protractor-ci.conf.js",
"e2e": "ng e2e"
},
"private": true,
"devDependencies": {
"#angular-devkit/build-angular": "~12.0.1",
"#angular/compiler-cli": "~12.0.1",
"#types/jasmine": "~3.7.4",
"#types/node": "^15.6.0",
"codelyzer": "^6.0.2",
"jasmine-core": "~3.7.1",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.3.2",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-coverage-istanbul-reporter": "^3.0.3",
"karma-jasmine": "~4.0.1",
"karma-jasmine-html-reporter": "^1.6.0",
"karma-spec-reporter": "0.0.32",
"protractor": "~7.0.0",
"puppeteer": "^9.1.1",
"ts-node": "~9.1.1",
"tslint": "~6.1.0",
"typescript": "~4.2.4"
}
}
npm version output:
{
npm: '7.11.2',
node: '12.18.1',
v8: '7.8.279.23-node.38',
uv: '1.38.0',
zlib: '1.2.11',
brotli: '1.0.7',
ares: '1.16.0',
modules: '72',
nghttp2: '1.41.0',
napi: '6',
llhttp: '2.0.4',
http_parser: '2.9.3',
openssl: '1.1.1g',
cldr: '37.0',
icu: '67.1',
tz: '2019c',
unicode: '13.0'
}
ng --version output:
Angular CLI: 12.0.1
Node: 12.18.1
Package Manager: npm 7.11.2
OS: win32 x64
Angular:
...
Package Version
------------------------------------------------------
#angular-devkit/architect 0.1200.1 (cli-only)
#angular-devkit/core 12.0.1 (cli-only)
#angular-devkit/schematics 12.0.1 (cli-only)
#schematics/angular 12.0.1 (cli-only)
I've found a solution.
First, check how to update:
https://update.angular.io/?l=2&v=12.0-12.0
Was updating from 12 to 13
After this, ng serve worked more or less with a few error messages that some dependencies couldn't be resolved like #angular/core
npm install #angular/core
and for all other findings
after this, all was working again
Related
I'm building my Angular Application.But, when I execute the application using ng serve -o or by pressing run in IntellijI got the following error.
ERROR in node_modules/rxjs/internal/types.d.ts(90,44): error TS1005: ';' expected.
node_modules/rxjs/internal/types.d.ts(90,74): error TS1005: ';' expected.
node_modules/rxjs/internal/types.d.ts(90,77): error TS1109: Expression expected.
node_modules/rxjs/internal/types.d.ts(91,52): error TS1005: ';' expected.
node_modules/rxjs/internal/types.d.ts(91,88): error TS1005: ';' expected.
node_modules/rxjs/internal/types.d.ts(91,92): error TS1109: Expression expected.
I have inspected types.d.ts as I know it is created by Angular. I'm not able to understand the error. Note that after I got this error I deleted node_modules and I installed using npm install wished I got away still I got this error. I tried a lot of solutions proposing by old posts (2019)
Here is my package.JSON file:
{
"name": "search-ui",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular-devkit/build-angular": "^0.13.0",
"#angular/animations": "^6.1.10",
"#angular/cdk": "^7.1.0",
"#angular/common": "^6.0.0",
"#angular/compiler": "^6.0.0",
"#angular/core": "^6.0.0",
"#angular/forms": "^6.0.0",
"#angular/http": "^6.0.0",
"#angular/material": "^7.1.0",
"#angular/platform-browser": "^6.0.0",
"#angular/platform-browser-dynamic": "^6.0.0",
"#angular/router": "^6.0.0",
"angular2-jwt": "0.2.3",
"bootstrap": "^3.3.7",
"core-js": "^2.5.4",
"ngx-toastr": "^8.7.3",
"rxjs": "6.6.7",
"rxjs-compat": "6.2.2",
"zone.js": "^0.8.26"
},
"devDependencies": {
"#angular/cli": "~6.0.0",
"#angular/compiler-cli": "^6.0.0",
"#angular/language-service": "^6.0.0",
"#types/jasmine": "~2.8.6",
"#types/jasminewd2": "~2.0.3",
"#types/node": "~8.9.4",
"codelyzer": "6.0.1",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"protractor": "~5.3.0",
"ts-node": "~5.0.1",
"tslint": "~5.9.1",
"typescript": "^2.7.2"
}
}
my versions :
Angular CLI: 6.0.8
Node: 14.16.0
OS: win32 x64
Angular: 6.1.10
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
#angular-devkit/architect 0.13.10
#angular-devkit/build-angular 0.13.10
#angular-devkit/build-optimizer 0.13.10
#angular-devkit/build-webpack 0.13.10
#angular-devkit/core 7.3.10
#angular-devkit/schematics 0.6.8
#angular/cdk 7.3.7
#angular/cli 6.0.8
#angular/material 7.3.7
#ngtools/webpack 7.3.10
#schematics/angular 0.6.8
#schematics/update 0.6.8
rxjs 6.6.7
typescript 2.7.2
webpack 4.29.0
Any help is more than appreciated :)
story
Last week I reinstalled my kubuntu, next to that I want to work on projects stored on another hard drive.
When I use Yarn Install I have the following error (see §log below).
Before reinstalling kubuntu everything was working fine.
spec
hadock in ~
➜ nvm -v
0.37.2
hadock in ~
➜ node -v
v15.8.0
hadock in ~
➜ npm -v
7.5.1
hadock in ~
➜ yarn -v
1.22.10
hadock in ~
➜ git --version
git version 2.27.0
my package.json
{
"name": "api",
"private": true,
"version": "1.0.0",
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"dev": "NODE_ENV=development nest start --watch",
"dev:win": "SET NODE_ENV=development&& nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/src/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"generate-data": "node scripts/generate-dev-data-index.js"
},
"dependencies": {
"#nestjs/common": "^7.4.4",
"#nestjs/core": "^7.4.4",
"#nestjs/jwt": "^7.1.0",
"#nestjs/mongoose": "^7.0.2",
"#nestjs/passport": "^7.1.0",
"#nestjs/platform-express": "^7.4.4",
"#nestjs/swagger": "^4.6.1",
"#nestjs/testing": "^7.4.4",
"#vonage/server-sdk": "^2.10.4",
"aws-sdk": "^2.790.0",
"bcrypt": "^5.0.0",
"body-parser": "^1.19.0",
"class-transformer": "^0.3.1",
"class-validator": "^0.12.2",
"dotenv": "^8.2.0",
"exifreader": "^3.12.6",
"express": "^4.17.1",
"faker": "^5.1.0",
"google-libphonenumber": "^3.2.15",
"jsonapi-serializer": "^3.6.6",
"jwt-decode": "^3.1.2",
"mongodb": "^3.6.2",
"mongoose": "^5.11.15",
"multer": "^1.4.2",
"nestjs-pino": "^1.2.0",
"passport": "^0.4.1",
"passport-jwt": "^4.0.0",
"passport-local": "^1.0.0",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^6.6.3",
"sharp": "^0.26.2",
"sib-api-v3-typescript": "^2.0.2",
"swagger-ui-express": "^4.1.4"
},
"devDependencies": {
"#nestjs/cli": "^7.5.1",
"#nestjs/schematics": "^7.1.2",
"#shelf/jest-mongodb": "^1.2.3",
"#types/aws-sdk": "^2.7.0",
"#types/bcrypt": "^3.0.0",
"#types/body-parser": "^1.19.0",
"#types/dotenv": "^8.2.0",
"#types/express": "^4.17.8",
"#types/faker": "^5.1.2",
"#types/google-libphonenumber": "^7.4.19",
"#types/jest": "^26.0.14",
"#types/jsonapi-serializer": "^3.6.3",
"#types/node": "^14.11.8",
"#types/passport": "^1.0.4",
"#types/passport-jwt": "^3.0.3",
"#types/sharp": "^0.26.1",
"#types/supertest": "^2.0.10",
"#typescript-eslint/eslint-plugin": "^4.4.0",
"#typescript-eslint/parser": "^4.4.0",
"eslint": "^7.11.0",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-config-prettier": "^6.12.0",
"eslint-plugin-import": "^2.22.1",
"jest": "^26.5.3",
"jest-serial-runner": "^1.1.0",
"pino-pretty": "^4.3.0",
"prettier": "^2.1.2",
"supertest": "^5.0.0",
"ts-jest": "^26.4.1",
"ts-loader": "^8.0.4",
"ts-node": "^9.0.0",
"tsconfig-paths": "^3.9.0",
"typescript": "^4.0.3"
},
"jest": {
"displayName": {
"name": "API",
"color": "blue"
},
"verbose": true,
"runner": "jest-serial-runner",
"testSequencer": "../src/_test/config/sequencer.jest.js",
"setupFiles": [
"../src/_test/config/dotenv.module.ts"
],
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".spec.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node",
"preset": "#shelf/jest-mongodb",
"testTimeout": 30000
}
}
Log
[4/4] Building fresh packages...
⠁
[6/6] ⠂ mongodb-memory-server
[2/6] ⠂ bcrypt
[3/6] ⠂ exifreader
[4/6] ⠂ sharp
verbose 24.479452317
verbose 24.558439202 Error: /home/hadock/samus/Projects/rm/rm-api/node_modules/bcrypt: Command failed.
Exit code: 126
Command: node-pre-gyp install --fallback-to-build
Arguments:
Directory: /home/hadock/samus/Projects/rm/rm-api/node_modules/bcrypt
Output:
/bin/sh: 1: node-pre-gyp: Permission denied
at ProcessTermError.ExtendableBuiltin (/home/hadock/.nvm/versions/node/v15.8.0/lib/node_modules/yarn/lib/cli.js:721:66)
at ProcessTermError.MessageError (/home/hadock/.nvm/versions/node/v15.8.0/lib/node_modules/yarn/lib/cli.js:750:123)
at new ProcessTermError (/home/hadock/.nvm/versions/node/v15.8.0/lib/node_modules/yarn/lib/cli.js:790:113)
at ChildProcess.<anonymous> (/home/hadock/.nvm/versions/node/v15.8.0/lib/node_modules/yarn/lib/cli.js:25884:17)
at ChildProcess.emit (node:events:378:20)
at maybeClose (node:internal/child_process:1067:16)
at Socket.<anonymous> (node:internal/child_process:453:11)
at Socket.emit (node:events:378:20)
at Pipe.<anonymous> (node:net:665:12)
error /home/hadock/samus/Projects/rm/rm-api/node_modules/bcrypt: Command failed.
Exit code: 126
Command: node-pre-gyp install --fallback-to-build
Arguments:
my test
git clone the project, yarn -> doesn't work
uninstall bcrypt from the package & reinstall via yarn install bcrypt -> doesn't work
uninstall nvm & yarn & reinstall and yarn install -> doesn't work
i check my permission into the project file every file is set to my user drwxrwxr-x hadock hadock
i do npm install -g node-gyp & rm -rf node_modules & yarn fix the error but got a new one (opencollective: Permission denied)
[4/4] Building fresh packages...
[1/6] ⠂ #nestjs/core
[2/6] ⠂ bcrypt
[3/6] ⠂ exifreader
[4/6] ⠂ sharp
verbose 35.698648389 /bin/sh: 1: opencollective: Permission denied
verbose 35.744661021 Error: /home/hadock/samus/Projects/rm/rm-api/node_modules/bcrypt: Command failed.
Exit code: 126
Command: node-pre-gyp install --fallback-to-build
Arguments:
Directory: /home/hadock/samus/Projects/rm/rm-api/node_modules/bcrypt
Output:
/bin/sh: 1: node-pre-gyp: Permission denied
at ProcessTermError.ExtendableBuiltin (/home/hadock/.nvm/versions/node/v15.8.0/lib/node_modules/yarn/lib/cli.js:721:66)
at ProcessTermError.MessageError (/home/hadock/.nvm/versions/node/v15.8.0/lib/node_modules/yarn/lib/cli.js:750:123)
at new ProcessTermError (/home/hadock/.nvm/versions/node/v15.8.0/lib/node_modules/yarn/lib/cli.js:790:113)
at ChildProcess.<anonymous> (/home/hadock/.nvm/versions/node/v15.8.0/lib/node_modules/yarn/lib/cli.js:25884:17)
at ChildProcess.emit (node:events:378:20)
at maybeClose (node:internal/child_process:1067:16)
at Socket.<anonymous> (node:internal/child_process:453:11)
at Socket.emit (node:events:378:20)
at Pipe.<anonymous> (node:net:665:12)
error /home/hadock/samus/Projects/rm/rm-api/node_modules/bcrypt: Command failed.
Exit code: 126
Command: node-pre-gyp install --fallback-to-build
Arguments:
doesn't work or not relevant
Bcrypt fails to install
https://github.com/kelektiv/node.bcrypt.js/issues/803
https://github.com/kelektiv/node.bcrypt.js/issues/848
npm install bcrypt failed node
https://github.com/kelektiv/node.bcrypt.js/issues/590
https://github.com/kelektiv/node.bcrypt.js/issues/514
Edit 15 Feb 2021 - 1
I have clone the project in my os drive and everything works fine.
So I run chmod -R ug+rwx XXXX where XXXX is my project drive.
But the yarn install doesn't work.
I keep searching.
Edit 15 Feb 2021 - 2
The problem is a problem of right.
I had to change the way my second drive was mounted on boot in the fstab file (the mount option part) :
+ UUID="12345" /home/hadock/samus ext4 defaults 0 1
I had the same problem with one ubuntu image in one of my containers:
You can try sudo apt-get install build-essential on your computer or
apk add --no-cache --virtual .gyp \
python \
make \
g++ \
&& apk del .gyp
to be more specific (recommended for images)
Have tried every single option in StackOverflow forums and others, no luck.
Tried and Didn't work
npm uninstall #angular-devkit/build-angular
npm cache clean -f
npm install #angular-devkit/build-angular
Deleted the node_modules folder and ran npm install, did not work
Have tried to uninstall and install #angular-cli
Most answers are from last year or with a much older version of angular that I am using. Please advise
While trying to deploy using build --prod these are the errors I am getting
Schema validation failed with the following errors:
2020-10-13 05:17:31 pm 0 ms output Data path ".builders['app-shell']" should have required property 'class'.
2020-10-13 05:17:31 pm 2 ms output Error: Schema validation failed with the following errors:
2020-10-13 05:17:31 pm 0 ms output Data path ".builders['app-shell']" should have required property 'class'.
2020-10-13 05:17:31 pm 1 ms output at MergeMapSubscriber._registry.compile.pipe.operators_1.concatMap.validatorResult [as project] (/usr/local/lib/node_modules/#angular/cli/node_modules/#angular-devkit/core/src/workspace/workspace.js:215:42)
2020-10-13 05:17:31 pm 0 ms output at MergeMapSubscriber._tryNext (/usr/local/lib/node_modules/#angular/cli/node_modules/rxjs/internal/operators/mergeMap.js:69:27)
2020-10-13 05:17:31 pm 0 ms output at MergeMapSubscriber._next (/usr/local/lib/node_modules/#angular/cli/node_modules/rxjs/internal/operators/mergeMap.js:59:18)
2020-10-13 05:17:31 pm 1 ms output at MergeMapSubscriber.Subscriber.next (/usr/local/lib/node_modules/#angular/cli/node_modules/rxjs/internal/Subscriber.js:67:18)
2020-10-13 05:17:31 pm 0 ms output at MergeMapSubscriber.notifyNext (/usr/local/lib/node_modules/#angular/cli/node_modules/rxjs/internal/operators/mergeMap.js:92:26)
2020-10-13 05:17:31 pm 0 ms output at InnerSubscriber._next (/usr/local/lib/node_modules/#angular/cli/node_modules/rxjs/internal/InnerSubscriber.js:28:21)
2020-10-13 05:17:31 pm 1 ms output at InnerSubscriber.Subscriber.next (/usr/local/lib/node_modules/#angular/cli/node_modules/rxjs/internal/Subscriber.js:67:18)
2020-10-13 05:17:31 pm 0 ms output at MapSubscriber._next (/usr/local/lib/node_modules/#angular/cli/node_modules/rxjs/internal/operators/map.js:55:26)
2020-10-13 05:17:31 pm 0 ms output at MapSubscriber.Subscriber.next (/usr/local/lib/node_modules/#angular/cli/node_modules/rxjs/internal/Subscriber.js:67:18)
2020-10-13 05:17:31 pm 1 ms output at SwitchMapSubscriber.notifyNext (/usr/local/lib/node_modules/#angular/cli/node_modules/rxjs/internal/operators/switchMap.js:86:26)
2020-10-13 05:17:31 pm 0 ms output at Inner Subscriber. Next (/usr/local/lib/node_modules/#angular/cli/node_modules/rxjs/internal/InnerSubscriber.js:28:21)
2020-10-13 05:17:31 pm 0 ms output at InnerSubscriber.Subscriber.next (/usr/local/lib/node_modules/#angular/cli/node_modules/rxjs/internal/Subscriber.js:67:18)
2020-10-13 05:17:31 pm 1 ms output at /usr/local/lib/node_modules/#angular/cli/node_modules/rxjs/internal/util/subscribeTo.js:17:28
2020-10-13 05:17:31 pm 0 ms output at Object.subscribeToResult (/usr/local/lib/node_modules/#angular/cli/node_modules/rxjs/internal/util/subscribeToResult.js:10:45)
2020-10-13 05:17:31 pm 1 ms output at SwitchMapSubscriber. Inner Sub (/usr/local/lib/node_modules/#angular/cli/node_modules/rxjs/internal/operators/switchMap.js:65:54)
2020-10-13 05:17:31 pm 0 ms output at SwitchMapSubscriber. Next (/usr/local/lib/node_modules/#angular/cli/node_modules/rxjs/internal/operators/switchMap.js:55:14)
2020-10-13 05:17:31 pm 1 ms output Post-launch commands failed, but the current application symlink was updated.
2020-10-13 05:17:31 pm 0 ms output logout
2020-10-13 05:17:31 pm 1 ms failure Last exit code: 1
Deployment has failed.
Here is my package file
{
"name": "sts-skin-angular",
"version": "0.0.0",
"scripts": {
"ng-high-memory-serve": "node --max_old_space_size=8000 ./node_modules/#angular/cli/bin/ng serve --port",
"ng-high-memory-build": "node --max_old_space_size=8000 ./node_modules/#angular/cli/bin/ng build",
"ng-high-memory-build-prod": "node --max_old_space_size=8000 ./node_modules/#angular/cli/bin/ng build --prod",
"ng": "ng",
"start": "npm run ng-high-memory-serve",
"build": "npm run ng-high-memory-build --extract-css",
"build:prod": "npm run ng-high-memory-build-prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"dev:ssr": "ng run sts-skin-angular:serve-ssr",
"serve:ssr": "node dist/sts-skin-angular/server/main.js",
"build:ssr": "ng build --prod && ng run sts-skin-angular:server:production",
"prerender": "ng run sts-skin-angular:prerender"
},
"private": true,
"dependencies": {
"#agm/core": "^3.0.0-beta.0",
"#angular-devkit/build-angular": "^0.1001.6",
"#angular/animations": "~10.0.4",
"#angular/cli": "^10.0.5",
"#angular/common": "~10.0.4",
"#angular/compiler": "~10.0.4",
"#angular/compiler-cli": "~10.0.4",
"#angular/core": "~10.0.4",
"#angular/forms": "~10.0.4",
"#angular/platform-browser": "~10.0.4",
"#angular/platform-browser-dynamic": "~10.0.4",
"#angular/platform-server": "~10.0.4",
"#angular/router": "~10.0.4",
"#nguniversal/builders": "^10.1.0",
"#nguniversal/express-engine": "^10.0.1",
"#ngx-translate/core": "^13.0.0",
"#ngx-translate/http-loader": "^6.0.0",
"#trademe/ng-defer-load": "^8.2.1",
"#types/googlemaps": "^3.39.11",
"buttercms": "^1.2.3",
"express": "^4.15.2",
"ng-image-slider": "^2.6.4",
"ng6-toastr-notifications": "^1.0.4",
"ngx-bootstrap": "^5.6.1",
"ngx-cookie-service": "^10.0.1",
"ngx-order-pipe": "^2.0.4",
"ngx-pagination": "^5.0.0",
"rxjs": "~6.6.3",
"sweetalert": "^2.1.2",
"tslib": "^2.0.0",
"typescript": "~3.9.5",
"zone.js": "~0.10.3"
},
"devDependencies": {
"#types/express": "^4.17.0",
"#types/jasmine": "~3.5.0",
"#types/jasminewd2": "~2.0.3",
"#types/node": "^12.11.1",
"codelyzer": "^6.0.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",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0"
}
}
UPDATE
<code>
Angular CLI: 10.0.5
Node: 13.7.0
OS: win32 x64
Angular: 10.0.7
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router
Ivy Workspace: <error>
Package Version
-----------------------------------------------------------
#angular-devkit/architect 0.1001.6
#angular-devkit/build-angular 0.1001.6
#angular-devkit/build-optimizer 0.1001.6
#angular-devkit/build-webpack 0.1001.6
#angular-devkit/core 10.1.6
#angular-devkit/schematics 10.0.5
#angular/cli 10.0.5
#ngtools/webpack 10.1.6
#nguniversal/builders 10.1.0
#nguniversal/common 10.0.1
#nguniversal/express-engine 10.0.1
#schematics/angular 10.0.5
#schematics/update 0.1000.5
rxjs 6.6.3
typescript 3.9.7
webpack 4.44.1
</code>
UPDATE AFTER SUGGESTED FIX
NEW VERSION AND PACKAGE FILE
<code>
Angular CLI: 10.0.4
Node: 13.7.0
OS: win32 x64
Angular: 10.0.7
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router
Ivy Workspace: <error>
Package Version
-----------------------------------------------------------
#angular-devkit/architect 0.1000.4
#angular-devkit/build-angular 0.1000.4
#angular-devkit/build-optimizer 0.1000.4
#angular-devkit/build-webpack 0.1000.4
#angular-devkit/core 10.0.4
#angular-devkit/schematics 10.0.4
#angular/cli 10.0.4
#ngtools/webpack 10.0.4
#nguniversal/builders 10.1.0
#nguniversal/common 10.1.0
#nguniversal/express-engine 10.1.0
#schematics/angular 10.0.4
#schematics/update 0.1000.4
rxjs 6.6.3
typescript 3.9.7
webpack 4.43.0
</code>
<code>
{
"name": "sts-skin-angular",
"version": "0.0.0",
"scripts": {
"ng-high-memory-serve": "node --max_old_space_size=8000 ./node_modules/#angular/cli/bin/ng serve --port",
"ng-high-memory-build": "node --max_old_space_size=8000 ./node_modules/#angular/cli/bin/ng build",
"ng-high-memory-build-prod": "node --max_old_space_size=8000 ./node_modules/#angular/cli/bin/ng build --prod",
"ng": "ng",
"start": "npm run ng-high-memory-serve",
"build": "npm run ng-high-memory-build --extract-css",
"build:prod": "npm run ng-high-memory-build-prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"dev:ssr": "ng run sts-skin-angular:serve-ssr",
"serve:ssr": "node dist/sts-skin-angular/server/main.js",
"build:ssr": "ng build --prod && ng run sts-skin-angular:server:production",
"prerender": "ng run sts-skin-angular:prerender"
},
"private": true,
"dependencies": {
"#agm/core": "^3.0.0-beta.0",
"#angular-devkit/architect": "^0.1000.4",
"#angular-devkit/build-angular": "~0.1000.4",
"#angular-devkit/core": "^10.0.4",
"#angular/animations": "~10.0.4",
"#angular/cli": "~10.0.4",
"#angular/common": "~10.0.4",
"#angular/compiler": "~10.0.4",
"#angular/compiler-cli": "~10.0.4",
"#angular/core": "~10.0.4",
"#angular/forms": "~10.0.4",
"#angular/platform-browser": "~10.0.4",
"#angular/platform-browser-dynamic": "~10.0.4",
"#angular/platform-server": "~10.0.4",
"#angular/router": "~10.0.4",
"#nguniversal/builders": "^10.1.0",
"#nguniversal/express-engine": "^10.0.4",
"#ngx-translate/core": "^13.0.0",
"#ngx-translate/http-loader": "^6.0.0",
"#trademe/ng-defer-load": "^8.2.1",
"#types/googlemaps": "^3.39.11",
"buttercms": "^1.2.3",
"express": "^4.15.2",
"ng-image-slider": "^2.6.4",
"ng6-toastr-notifications": "^1.0.4",
"ngx-bootstrap": "^5.6.1",
"ngx-cookie-service": "^10.0.1",
"ngx-order-pipe": "^2.0.4",
"ngx-pagination": "^5.0.0",
"rxjs": "~6.6.3",
"sweetalert": "^2.1.2",
"tslib": "^2.0.0",
"typescript": "~3.9.5",
"zone.js": "~0.10.3"
},
"devDependencies": {
"#types/express": "^4.17.0",
"#types/jasmine": "~3.5.0",
"#types/jasminewd2": "~2.0.3",
"#types/node": "^12.11.1",
"codelyzer": "^6.0.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",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0"
}
}
</code>
Your #angular/cli and #angular-devkit/build-angular versions don't align.
Make sure they align. It's generally safe if they reflect the version of the rest of your #angular packages (10.0.4). So update them to:
"#angular-devkit/build-angular": "~0.1000.4",
"#angular/cli": "~10.0.4",
Then delete your node_modules folder and rename your lock file.
npm: package-lock.json -> package-lock.json.old
yarn: yarn.lock -> yarn.lock.old
Run npm install or yarn install and build your app.
If everything is ok you can remove the old lock file package-lock.json.old or yarn.lock.old.
You should generally update Angular only with ng update as this might run important migrations.
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
I have a project that is built in angular 5. here is the package.json
{
"name": "ff-client",
"version": "0.2.0",
"license": "",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint --type-check",
"e2e": "ng e2e",
"xprecommit": "ng lint --type-check && ng test --single-run --code-coverage",
"xprepush": "ng build --prod",
"i18n": "ng xi18n --i18n-format xlf --output-path src/locale --locale en --progress",
"i18n-merge": "xliffmerge --profile xliffmerge.json",
"browserstack": "ng e2e --no-serve --config protractor.browserstack.conf.js",
"upgrade": "yarn upgrade-interactive --latest",
"build-en": "ng build --prod --e deploy --output-path=dist/en --i18nFile=src/locale/messages.en.xlf --i18nFormat=xlf --locale=en --base-href /en/",
"build-da": "ng build --prod --e deploy --output-path=dist/da --i18nFile=src/locale/messages.da.xlf --i18nFormat=xlf --locale=da --base-href /da/",
"build-fo": "ng build --prod --e deploy --output-path=dist/fo --i18nFile=src/locale/messages.fo.xlf --i18nFormat=xlf --locale=fo --base-href /fo/",
"build-root": "copy dist\\en\\web.config dist\\ && del dist\\en\\web.config && del dist\\da\\web.config && del dist\\fo\\web.config",
"build-prod": "npm run build-en && npm run build-da && npm run build-fo && npm run build-root"
},
"private": true,
"dependencies": {
"#angular/animations": "5.2.9",
"#angular/cdk": "^5.2.4",
"#angular/common": "5.2.9",
"#angular/compiler": "5.2.9",
"#angular/core": "5.2.9",
"#angular/flex-layout": "^5.0.0-beta.14",
"#angular/forms": "5.2.9",
"#angular/http": "5.2.9",
"#angular/material": "^5.2.4",
"#angular/platform-browser": "5.2.9",
"#angular/platform-browser-dynamic": "5.2.9",
"#angular/router": "5.2.9",
"#angular/service-worker": "5.2.9",
"#aspnet/signalr": "^1.0.0-rc1-update1",
"#auth0/angular-jwt": "^1.0.0-beta.9",
"#ngrx/effects": "^5.1.0",
"#ngrx/router-store": "^5.0.1",
"#ngrx/store": "^5.1.0",
"#ngrx/store-devtools": "^5.1.0",
"angular-in-memory-web-api": "^0.5.2",
"applicationinsights-js": "^1.0.15",
"core-js": "^2.5.3",
"hammerjs": "^2.0.8",
"moment": "^2.20.1",
"ng-recaptcha": "^3.0.3",
"ng2-file-upload": "^1.3.0",
"ngrx-store-logger": "^0.2.0",
"ngx-perfect-scrollbar": "^5.3.5",
"redux-beacon": "^1.2.1",
"rxjs": "^5.5.8",
"zone.js": "^0.8.26"
},
"devDependencies": {
"#angular/cli": "1.7.4",
"#angular/compiler-cli": "5.2.9",
"#angular/language-service": "5.2.9",
"#types/jasmine": "~2.8.6",
"#types/jasminewd2": "~2.0.2",
"#types/node": "~9.4.6",
"chai": "^4.1.2",
"codelyzer": "~4.1.0",
"cucumber": "^4.0.0",
"husky": "^0.14.3",
"jasmine-core": "~2.99.1",
"jasmine-marbles": "^0.2.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.4.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-teamcity-reporter": "^1.0.1",
"ngx-i18nsupport": "^0.12.0",
"protractor": "^5.3.0",
"protractor-cucumber-framework": "^4.2.0",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "2.6.2"
}
}
I have download npm and angular-cli.
after installing these, I did npm install to get the required modules. but when I do "ng serve" it shows an error.
ERROR in
node_modules/#angular/flex-layout/core/typings/observable-media/observa
ble-media.d.ts(1,22): error TS2305: Module
'"D:/Projects/FlexFunding/app-dk/Clie
nt/node_modules/rxjs/Rx"' has no exported member 'Subscribable'.
I know now it is angular 6 and rxjs has updated in this version. but how can I solve this issue without migrating this project from angular version 5 to 6. I just need to build and run the project.
i have tried replace rxjs folder under node modules from a running a project. but no luck.
Edit: I have uninstall current version and downgraded to version angular cli version 1.7.4 but the error is same.
ERROR in
node_modules/#angular/flex-layout/core/typings/observable-media/observa
ble-media.d.ts(1,22): error TS2305: Module
'"D:/Projects/FlexFunding/app-dk/Clie nt/node_modules/rxjs/Rx"' has no
exported member 'Subscribable'.
in package.json one of the dependency is
"#angular/flex-layout": "^5.0.0-beta.14"
for ^ of "^5.0.0-beta.14", npm installs the latest version of flex-layout and in the latest version felx-layout uses RxJS 6. But as the project is an Angular 5 project, it uses previous version of RxJs. So, flex-layout failed to import the required libraries because RxJs 6 is not there.
so, the solution that worked for me is to change package.json
"#angular/flex-layout": "5.0.0-beta.14"
then npm install
Try reinstall your application
npm i
If this doesn't work, try delete node_modules folder and reinstall.