Cannot find module '#angular/compiler-cli/ngcc' - node.js

in using below versions of angular:
there is a build script to build and I run npm run build to run this project but I am getting an error after changed my laptop and newly installed nodjs angular
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 9.0.1
Node: 12.15.0
OS: win32 x64
Angular:
...
Ivy Workspace:
Package Version
------------------------------------------------------
#angular-devkit/architect 0.900.1
#angular-devkit/core 9.0.1
#angular-devkit/schematics 9.0.1
#schematics/angular 9.0.1
#schematics/update 0.900.1
rxjs 6.5.3
may package json is
{
"name": "webprimeng",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --prod --output-path ../src/main/resources/static --base-href /transaction/ --deploy-url /transaction/",
"watch": "ng build --prod --output-path ../src/main/resources/static --base-href /transaction/ --deploy-url /transaction/ --watch",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/animations": "~7.0.0",
"#angular/common": "~7.0.0",
"#angular/compiler": "~7.0.0",
"#angular/core": "~7.0.0",
"#angular/forms": "~7.0.0",
"#angular/http": "~7.0.0",
"#angular/platform-browser": "~7.0.0",
"#angular/platform-browser-dynamic": "~7.0.0",
"#angular/router": "~7.0.0",
"#ng-bootstrap/ng-bootstrap": "^3.3.1",
"#ngx-pwa/local-storage": "^7.4.2",
"angular-font-awesome": "^3.1.2",
"angular-web-storage": "^4.1.0",
"bootstrap": "^4.3.1",
"core-js": "^2.6.10",
"ng2-cookies": "^1.0.12",
"primeflex": "^1.0.0",
"primeicons": "^1.0.0",
"primeng": "^6.1.7",
"rxjs": "^6.5.3",
"rxjs-compat": "^6.5.3",
"zone.js": "^0.8.29"
},
"devDependencies": {
"#angular-devkit/build-angular": "^0.900.1",
"#angular/cli": "^9.0.1",
"#angular/compiler-cli": "^9.0.0",
"#angular/language-service": "~7.0.0",
"#types/jasmine": "^2.8.16",
"#types/jasminewd2": "^2.0.8",
"#types/node": "~8.9.4",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^2.0.6",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "^5.4.2",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.1.6"
}
}
my error is :
An unhandled exception occurred: Cannot find module '#angular/compiler-cli/ngcc'
Require stack:
- D:\workspace\webprimeng\primeng\node_modules\#ngtools\webpack\src\ngcc_processor.js
- D:\workspace\webprimeng\primeng\node_modules\#ngtools\webpack\src\angular_compiler_plugin.js
- D:\workspace\webprimeng\primeng\node_modules\#ngtools\webpack\src\index.js
- D:\workspace\webprimeng\primeng\node_modules\#angular-devkit\build-angular\src\angular-cli-files\models\webpack-configs\typescript.js
- D:\workspace\webprimeng\primeng\node_modules\#angular-devkit\build-angular\src\angular-cli-files\models\webpack-configs\index.js
- D:\workspace\webprimeng\primeng\node_modules\#angular-devkit\build-angular\src\browser\index.js
- D:\workspace\webprimeng\primeng\node_modules\#angular-devkit\architect\node\node-modules-architect-host.js
- D:\workspace\webprimeng\primeng\node_modules\#angular-devkit\architect\node\index.js
- D:\workspace\webprimeng\primeng\node_modules\#angular\cli\models\architect-command.js
- D:\workspace\webprimeng\primeng\node_modules\#angular\cli\commands\build-impl.js
- D:\workspace\webprimeng\primeng\node_modules\#angular-devkit\schematics\tools\export-ref.js
- D:\workspace\webprimeng\primeng\node_modules\#angular-devkit\schematics\tools\index.js
- D:\workspace\webprimeng\primeng\node_modules\#angular\cli\utilities\json-schema.js
- D:\workspace\webprimeng\primeng\node_modules\#angular\cli\models\command-runner.js
- D:\workspace\webprimeng\primeng\node_modules\#angular\cli\lib\cli\index.js
- D:\workspace\webprimeng\primeng\node_modules\#angular\cli\lib\init.js
- D:\workspace\webprimeng\primeng\node_modules\#angular\cli\bin\ng
See "C:\Users\yyy~1\AppData\Local\Temp\ng-hLuf5T\angular-errors.log" for further details.
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file C:\Windows\system32\cmd.exe
npm ERR! errno ENOENT
npm ERR! webprimeng#0.0.0 build: `ng build --prod --output-path ../src/main/resources/static --base-href /transaction/ --deploy-url /transaction/`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the webprimeng#0.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\yyyy\AppData\Roaming\npm-cache\_logs\2020-02-09T14_34_11_713Z-debug.log

There is a version mismatch between your project and the devDependency. You might have probably used npm audit fix --force or a similar auto update command, which might have updated the devDependencies in "package.json" file.

Related

npm install not working in angular project

Runnig npm install command is giving errors.
THE ERROR:
``
PS D:\t> npm install
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: public_services#1.0.0
npm ERR! Found: typescript#4.9.4
npm ERR! node_modules/typescript
npm ERR! dev typescript#"~4.9.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer typescript#">=4.8.2 <4.9" from #angular/compiler-cli#15.0.4
npm ERR! node_modules/#angular/compiler-cli
npm ERR! dev #angular/compiler-cli#"~15.0.4" from the root project
npm ERR! peer #angular/compiler-cli#"15.0.4" from #angular/localize#15.0.4
npm ERR! node_modules/#angular/localize
npm ERR! dev #angular/localize#"^15.0.4" from the root project
npm ERR! 1 more (#ng-bootstrap/ng-bootstrap)
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\sayed.hussainullah\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\sayed.hussainullah\AppData\Local\npm-cache\_logs\2023-01-11T06_57_30_299Z-debug-0.log
``
Global angular version:
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 15.0.5
Node: 16.16.0
Package Manager: npm 8.17.0
OS: win32 x64
Angular:
...
Package Version
------------------------------------------------------
#angular-devkit/architect 0.1500.5 (cli-only)
#angular-devkit/core 15.0.5 (cli-only)
#angular-devkit/schematics 15.0.5 (cli-only)
#schematics/angular 15.0.5 (cli-only)
Package.json file:
{
"name": "public_services",
"version": "1.0.0",
"license": "",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/animations": "~15.0.4",
"#angular/cdk": "^15.0.4",
"#angular/common": "~15.0.4",
"#angular/compiler": "~15.0.4",
"#angular/core": "~15.0.4",
"#angular/forms": "~15.0.4",
"#angular/platform-browser": "~15.0.4",
"#angular/platform-browser-dynamic": "~15.0.4",
"#angular/router": "15.0.4",
"#fortawesome/angular-fontawesome": "^0.12.1",
"#fortawesome/fontawesome-svg-core": "^6.2.1",
"#fortawesome/free-brands-svg-icons": "^6.2.1",
"#fortawesome/free-regular-svg-icons": "^6.2.1",
"#fortawesome/free-solid-svg-icons": "^6.2.1",
"#ng-bootstrap/ng-bootstrap": "14.0.1",
"#ng-select/ng-select": "^10.0.3",
"#ngx-translate/core": "^14.0.0",
"#ngx-translate/http-loader": "7.0.0",
"#swimlane/ngx-datatable": "^20.1.0",
"angular-archwizard": "7.0.0",
"angular-feather": "^6.5.0",
"bootstrap": "5.2.3",
"chart.js": "^4.1.2",
"classlist.js": "1.1.20150312",
"core-js": "3.27.1",
"date-fns": "2.29.3",
"gulp": "4.0.2",
"hopscotch": "0.3.1",
"intl": "1.2.5",
"moment": "2.29.4",
"ng-lazyload-image": "^9.1.3",
"ng2-charts": "^4.1.1",
"ng2-file-upload": "3.0.0",
"ng2-img-cropper": "0.9.0",
"ng2-jalali-date-picker": "^2.2.8",
"ngx-bootstrap": "^10.2.0",
"ngx-chips": "3.0.0",
"ngx-datatable": "^1.0.3",
"ngx-dropzone-wrapper": "^13.0.0",
"ngx-perfect-scrollbar": "^7.2.1",
"ngx-toastr": "16.0.2",
"node-sass": "^8.0.0",
"nouislider": "15.6.1",
"prismjs": "1.29.0",
"resize-observer-polyfill": "1.5.1",
"rxjs": "7.8.0",
"screenfull": "6.0.2",
"sweetalert2": "11.6.16",
"tslib": "^2.4.1",
"web-animations-js": "^2.3.2",
"xlsx": "^0.18.5",
"zone.js": "~0.12.0"
},
"devDependencies": {
"#angular-devkit/build-angular": "~15.0.5",
"#angular/cli": "~15.0.5",
"#angular/compiler-cli": "~15.0.4",
"#angular/language-service": "~15.0.4",
"#angular/localize": "^15.0.4",
"#types/core-js": "2.5.5",
"#types/jasmine": "^4.3.1",
"#types/jasminewd2": "~2.0.10",
"#types/jquery": "^3.5.16",
"#types/node": "^18.11.18",
"codelyzer": "^6.0.2",
"jasmine-core": "~4.5.0",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.4.1",
"karma-chrome-launcher": "~3.1.1",
"karma-cli": "~2.0.0",
"karma-coverage-istanbul-reporter": "~3.0.3",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "^2.0.0",
"protractor": "~7.0.0",
"rxjs-compat": "6.6.7",
"ts-node": "~10.9.1",
"tslint": "~6.1.0",
"typescript": "~4.9.4"
}
}
I have tried:
delete node modules.
clear cache.
unistall node.js and reinstall lower version.
installed msbuild-tools.
so far non-of these methods worked
You should try running npm install --legacy-peer-deps, in order to ignore dependencies between packages. Nevertheless the root cause of your problem is that your installed angular versions expects typescript version >=4.8.2 and <4.9, but 4.9.4 will be installed. So a solution might be to downgrade your typescript version or update your angular versions.
There are limitations of npm's Install Algorithm, So npm will refuse to install any package with an identical name to the current package. It will overridden with the --force flag, but in most cases can simply be addressed by changing the local package name.
So you need to use --force flag to re-install packages again like below:
npm install --force

error TS2305: Module "/node_modules/rxjs/Rx" has no exported member 'Subscribable'

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.

Trying to build Electron app with VSTS fails saying "error Please try running this command again as root/Administrator."

Using VSTS to build an Electron app but I keep having issues with my NPM tasks:
I am not the dev, I'm devops trying to get this to build in VSTS running the npm install VSTS task and that seems fine, but then I run the npm Custom task where my command is npm run electron-build and then it fails.
I am running this as the root admin so I am not sure why that message is coming up.
ALSO: if I rdp into the VM that has the vsts agent on it and run the same NPM commands it builds its only when VSTS builds it that it fails.
here is the output I get from VSTS
50375 verbose unlock done using C:\Users\LGBUILDADMIN\AppData\Roaming\npm-cache\_locks\staging-c7d6f0879aedfd51.lock for E:\Agents\LG-04\_work\244\s\node_modules\.staging
50376 verbose stack Error: EPERM: operation not permitted, scandir 'E:\Agents\LG-04\_work\244\s\node_modules\fsevents\node_modules\dashdash\node_modules'
50377 verbose cwd E:\Agents\LG-04\_work\244\s
50378 verbose Windows_NT 6.3.9600
50379 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\LGBUILDADMIN\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
50380 verbose node v8.11.1
50381 verbose npm v5.5.1
50382 error path E:\Agents\LG-04\_work\244\s\node_modules\fsevents\node_modules\dashdash\node_modules
50383 error code EPERM
50384 error errno -4048
50385 error syscall scandir
50386 error Error: EPERM: operation not permitted, scandir 'E:\Agents\LG-04\_work\244\s\node_modules\fsevents\node_modules\dashdash\node_modules'
50386 error { Error: EPERM: operation not permitted, scandir 'E:\Agents\LG-04\_work\244\s\node_modules\fsevents\node_modules\dashdash\node_modules'
50386 error stack: 'Error: EPERM: operation not permitted, scandir \'E:\\Agents\\LG-04\\_work\\244\\s\\node_modules\\fsevents\\node_modules\\dashdash\\node_modules\'',
50386 error errno: -4048,
50386 error code: 'EPERM',
50386 error syscall: 'scandir',
50386 error path: 'E:\\Agents\\LG-04\\_work\\244\\s\\node_modules\\fsevents\\node_modules\\dashdash\\node_modules' }
50387 error Please try running this command again as root/Administrator.
50388 verbose exit [ -4048, true ]
Error: Npm failed with return code: 4294963248
Here is the package.json as well.
{
"name": "sds",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --prod",
"test": "ng test --sourceMap=false --watch",
"lint": "ng lint",
"e2e": "ng e2e",
"tslint": "tslint -p tsconfig.json -e src/main.ts -e src/polyfills.ts -e src/test.ts -e e2e/src/*.ts",
"format-all": "prettier --write **/*.{ts,js,css,scss,json}",
"format": "pretty-quick --staged",
"electron": "electron .",
"electron-build": "ng build --prod --base-href ./ && electron .",
"package-mac": "ng build --prod --base-href ./ && electron-packager . --overwrite --platform=darwin --arch=x64 --prune=true --out=release-builds",
"package-win": "ng build --prod --base-href ./ && electron-packager . sds --overwrite --asar=false --platform=win32 --arch=ia32 --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName=\"SDS\"",
"package-linux": "ng build --prod --base-href ./ && electron-packager . sds --overwrite --asar=false --platform=linux --arch=x64 --prune=true --out=release-builds"
},
"private": true,
"main": "main.js",
"dependencies": {
"#angular/cli": "6.0.0",
"#angular/animations": "6.0.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/platform-browser": "6.0.0",
"#angular/platform-browser-dynamic": "6.0.0",
"#angular/router": "6.0.0",
"#types/lodash": "^4.14.110",
"angular-fastclick": "^1.0.4",
"core-js": "^2.5.7",
"hammerjs": "^2.0.8",
"latest": "^0.2.0",
"lodash": "^4.17.10",
"rxjs": "^6.2.1",
"shelljs": "^0.8.2",
"zone.js": "^0.8.26"
},
"devDependencies": {
"#angular-devkit/build-angular": "^0.6.8",
"#angular/cli": "6.0.0",
"#angular/compiler-cli": "6.0.0",
"#angular/language-service": "6.0.0",
"#types/jasmine": "^2.8.8",
"#types/jasminewd2": "~2.0.2",
"#types/node": "^6.0.113",
"codelyzer": "^4.4.2",
"electron": "^1.8.7",
"electron-packager": "^12.0.2",
"husky": "^0.14.3",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.4.3",
"karma-jasmine": "^1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"npm-run-all": "^4.1.3",
"prettier": "^1.13.7",
"pretty-quick": "^1.6.0",
"protractor": "~5.1.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"tslint-config-prettier": "^1.13.0",
"typescript": "2.7.2"
}
}
The answer to my question was that I was using the wrong cli command and was building and then immediately running the app and that would cause a time out since the app was still running in the background. I changed to a command that would only build the app and that has worked ever since.

NPM install results in 404 when installing angular deps

I have the latest node.js 8.x and npm 5.6.0 installed. When trying to do a npm install, I constantly get the following error:
npm ERR! code E404
npm ERR! 404 Not Found: #angular/router#5.2.0
The module that fails is different every time I retry the installation, but most typically it's #angular/forms#5.2.0, #angular/animations#5.2.0 and #angular/platform-browser#5.2.0
I do have a working internet connection
I have run npm config set registry https://registry.npmjs.org/.
I deleted the node_modules folder
I have deleted the cache: npm cache clean --force
An npm search does find the module:
C:\windows\system32>npm search #angular/router
NAME | DESCRIPTION | AUTHOR | DATE | VERSION | KEYWORDS
#angular/router | Angular -
the… | =angular | 2018-04-16 | 5.2.10 | angular router
What else can be wrong?
Here is the package.json for completeness:
{
"name": "App",
"angular-cli": {},
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --env=scapp",
"build-local": "ng build --env=dev",
"build-nonevis": "ng build --env=nonevis",
"test": "ng test",
"lint": "ng lint",
"lint-fix": "ng lint --fix",
"e2e": "ng e2e"
},
"dependencies": {
"#angular/animations": "5.2.0",
"#angular/common": "^5.2.0",
"#angular/compiler": "^5.2.0",
"#angular/core": "^5.2.0",
"#angular/forms": "5.2.0",
"#angular/http": "5.2.0",
"#angular/platform-browser": "5.2.0",
"#angular/platform-browser-dynamic": "5.2.0",
"#angular/router": "5.2.0",
"#ngx-translate/core": "9.1.1",
"#ngx-translate/http-loader": "2.0.1",
"#types/arcgis-js-api": "^4.4.0",
"#types/node": "9.4.0",
"angular2-esri-loader": "^1.0.0",
"cerialize": "^0.1.18",
"chart.js": "2.7.1",
"core-js": "^2.5.1",
"esri-loader": "^1.1.0",
"fullcalendar": "3.7.0",
"intl": "^1.2.5",
"jquery": "3.2.1",
"moment": "2.18.1",
"nanoscroller": "0.8.7",
"ngx-perfect-scrollbar": "5.3.4",
"primeng": "5.2.0",
"quill": "1.1.8",
"rxjs": "5.5.2",
"web-animations-js": "2.3.1",
"zone.js": "0.8.18"
},
"devDependencies": {
"#angular/cli": "^1.6.5",
"#angular/compiler-cli": "^5.2.0",
"#types/jasmine": "2.5.53",
"#types/jasminewd2": "2.0.2",
"#types/node": "6.0.60",
"codelyzer": "4.0.1",
"jasmine-core": "2.6.4",
"jasmine-spec-reporter": "4.1.1",
"karma": "1.7.1",
"karma-chrome-launcher": "2.1.1",
"karma-cli": "1.0.1",
"karma-jasmine": "1.1.0",
"karma-jasmine-html-reporter": "0.2.2",
"karma-coverage-istanbul-reporter": "1.3.0",
"protractor": "5.1.2",
"ts-node": "3.2.0",
"tslint": "5.7.0",
"typescript": "2.4.2"
}
}
The problem was caused by a local file .npmrc which contained the line always-auth = true. Removing this line resolved the issue. I have no idea how a 404 error is related to authentication, but noticed that after I switched to a mirror registry, it suddenly reported E401 instead of E404 like the official registry.
In my case, such issue was resolved by adding #latest to the command.
npm install -g #angular/cli#latest

Unmet peer dependency with ngx-webstorage but don't want to update to Angular 5.0.0

I'm trying to build a project that someone else has created but got the unmet dependency issue.
The NPM install command complains taht ngx-webstorage needs angular 5.0.0 and I indeed did not install 5.0.0 since the rest of the project cannot use that yet.
I globally installed node version 6.12 and have angular CLI version 3.10
$ which npm
/usr/bin/npm
$ npm --version
3.10.10
$ which ng
/usr/bin/ng
$ ng --version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 1.6.2
Node: 6.12.0
OS: linux x64
Angular:
...
I used the globally installed npm to install the dependencies and then see the "requires a peer of " message.
$ npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN ngx-webstorage#2.0.1 requires a peer of #angular/core#^5.0.0 but none was installed.
npm WARN ng2-pop-over#0.9.37 requires a peer of #angular/core#^2.4.0 but none was installed.
npm WARN ng2-pop-over#0.9.37 requires a peer of zone.js#^0.7.2 but none was installed.
npm WARN ng2-accordion#0.0.15 requires a peer of #angular/core#^2.0.0 but none was installed.
npm WARN #schematics/angular#0.0.49 requires a peer of #angular-devkit/schematics#0.0.34 but none was installed.
Here's the package.json
{
"name": "perkin-elmer",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"prestart": "npm install",
"start": "ng serve --proxy-config proxy.config.json",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/animations": "^4.2.4",
"#angular/common": "^4.2.4",
"#angular/compiler": "^4.2.4",
"#angular/core": "^4.2.4",
"#angular/forms": "^4.2.4",
"#angular/http": "^4.2.4",
"#angular/platform-browser": "^4.2.4",
"#angular/platform-browser-dynamic": "^4.2.4",
"#angular/router": "^4.2.4",
"#types/underscore": "^1.8.6",
"ag-grid": "^13.3.1",
"ag-grid-angular": "^13.3.0",
"angular-2-dropdown-multiselect": "^1.6.3",
"angular2-multiselect-checkbox-dropdown": "^1.5.0",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"jquery": "^2.2.4",
"lodash": "^4.17.4",
"ng-dynamic-component": "^1.1.0",
"ng2-accordion": "0.0.15",
"ng2-bootstrap-modal": "^1.0.1",
"ng2-pop-over": "^0.9.37",
"ngx-treeview": "^1.2.5",
"ngx-webstorage": "^2.0.1",
"rxjs": "^5.4.2",
"underscore": "^1.8.3",
"zone.js": "^0.8.14"
},
"devDependencies": {
"#angular/cli": "1.4.5",
"#angular/compiler-cli": "^4.2.4",
"#angular/language-service": "^4.2.4",
"#types/jasmine": "~2.5.53",
"#types/jasminewd2": "~2.0.2",
"#types/lodash": "^4.14.91",
"#types/node": "~6.0.60",
"codelyzer": "~3.2.0",
"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.3.3"
}
}
Since I did not develop the package, I am not sure why the ngx-webstorage was set to require version 2.0.1, which needs angular 5.0.0 since that clearly does not correspond to the rest of the angular versions requirements since those are still 4 in all cases.
I checked the npm site for the requirements for ngx-webstorage 2.0.1 and indeed the devDependencies is 5.0.0, but how could this package.json ever have worked? I know it works, since the app is running on some other site...
Any help is appreciated.
Appearantly, ngx-webstorage is abandoned. ( See: https://github.com/PillowPillow/ng2-webstorage/pull/91)
Use Angular 6 compatible fork of ngx-webstorage: https://www.npmjs.com/package/#rars/ngx-webstorage/v/3.0.0
npm install #rars/ngx-webstorage --save

Resources