npm install not working in angular project - node.js

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

Related

How to fix "publish-please can't be installed globally" error when I try `npm install firebase-tools -g`

I am facing an issue recently on my CI server. I always run npm install firebase-tools every time I would want to deploy my codes. However, recently this error prevents it from happenning.
Step to reproduce
cd to project folder
run npm install firebase-tools -g
output
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated cross-spawn-async#2.2.5: cross-spawn no longer requires a build toolchain, use it instead
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
> publish-please#5.5.2 preinstall C:\Users\ulala\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\publish-please
> node lib/pre-install.js
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! Starting from v2.0.0 publish-please can't be installed globally. !!
!! Use local installation instead : 'npm install --save-dev publish-please', !!
!! Or use npx if you do not want to install publish-please as a dependency. !!
!! (learn more: https://github.com/inikulin/publish-please#readme). !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#~2.1.2 (node_modules\firebase-tools\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! publish-please#5.5.2 preinstall: `node lib/pre-install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the publish-please#5.5.2 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Edit: here is my package.json. I don't install firebase-tools in my project.
package.json
{
"name": "app",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"test": "ng test",
"e2e": "ng e2e"
},
"husky": {
"hooks": {
"pre-commit": "npm run lint"
}
},
"private": true,
"dependencies": {
"#angular/animations": "~10.0.0",
"#angular/cdk": "^10.1.1",
"#angular/common": "~10.0.0",
"#angular/compiler": "~10.0.0",
"#angular/core": "~10.0.0",
"#angular/fire": "^6.0.2",
"#angular/flex-layout": "^10.0.0-beta.32",
"#angular/forms": "~10.0.0",
"#angular/material": "^10.0.0",
"#angular/platform-browser": "~10.0.0",
"#angular/platform-browser-dynamic": "~10.0.0",
"#angular/router": "~10.0.0",
"#ngrx/effects": "^10.0.0-beta.0",
"#ngrx/entity": "^10.0.0-beta.0",
"#ngrx/router-store": "^10.0.0-beta.0",
"#ngrx/store": "^10.0.0-beta.0",
"#ngrx/store-devtools": "^10.0.0-beta.0",
"#types/uuid": "^8.0.0",
"chart.js": "^2.9.3",
"compressorjs": "^1.0.6",
"emailjs-com": "^2.4.1",
"firebase": "^7.15.5",
"ng2-charts": "^2.4.1",
"rxjs": "~6.5.5",
"tslib": "^2.0.0",
"uuid": "^8.2.0",
"zone.js": "~0.10.3"
},
"devDependencies": {
"#angular-devkit/architect": ">= 0.900 < 0.1100",
"#angular-devkit/build-angular": "^0.1000.8",
"#angular/cli": "~10.0.0",
"#angular/compiler-cli": "~10.0.0",
"#types/jasmine": "~3.5.0",
"#types/jasminewd2": "~2.0.3",
"#types/node": "^12.11.1",
"codelyzer": "^6.0.0-next.1",
"firebase-tools": "^8.0.0",
"fuzzy": "^0.1.3",
"husky": "^4.2.5",
"inquirer": "^6.2.2",
"inquirer-autocomplete-prompt": "^1.0.1",
"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",
"open": "^7.0.3",
"prettier": "^2.0.5",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.3.0",
"typescript": "~3.9.5"
},
"repository": {
"type": "git",
"url": "git+ssh://git#gitlab.com/skilio/client-web-app-2.0.git"
},
"author": "Dody",
"license": "ISC",
"bugs": {
"url": "https://gitlab.com/skilio/client-web-app-2.0/issues"
},
"homepage": "https://gitlab.com/skilio/client-web-app-2.0#readme"
}
As of about an hour ago (as of this writing) a fix has been published to the cli-table dependency of firebase-tools. If you try npm install -g firebase-tools now, it should work.
In other words, you weren't doing anything wrong. This was a temporary breakage in a dependency of firebase-tools that existed for a few hours.

Cannot find module '#angular/compiler-cli/ngcc'

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.

installation npm failed for an existing project with angular 4

I'm begginer on angular 4. I tried to import an existing project on angular 4 to my local machine.
I used npm install to get nodes_modules using the package.json of the project, but I got this error :
This is the error log:
36096 warn #angular/material-moment-adapter#5.2.5 requires a peer of #angular/material#5.2.5 but none is installed. You must install peer dependencies yourself.
36097 warn bootstrap#4.0.0-beta.2 requires a peer of popper.js#^1.12.3 but none is installed. You must install peer dependencies yourself.
36098 warn ngx-malihu-scrollbar#1.2.2 requires a peer of #angular/core#^2.4.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
36099 warn angular2-perfect-scrollbar#2.0.6 requires a peer of #angular/common#^2.0.0 but none is installed. You must install peer dependencies yourself.
36100 warn angular2-perfect-scrollbar#2.0.6 requires a peer of #angular/core#^2.0.0 but none is installed. You must install peer dependencies yourself.
36101 warn angular2-perfect-scrollbar#2.0.6 requires a peer of #angular/platform-browser#^2.0.0 but none is installed. You must install peer dependencies yourself.
36102 warn angular2-perfect-scrollbar#2.0.6 requires a peer of zone.js#^0.7.0 but none is installed. You must install peer dependencies yourself.
36103 warn #angular/compiler-cli#5.0.2 requires a peer of typescript#>=2.4.2 <2.5 but none is installed. You must install peer dependencies yourself.
36104 warn #angular-devkit/schematics#0.0.52 requires a peer of #angular-devkit/core#0.0.29 but none is installed. You must install peer dependencies yourself.
36105 warn #schematics/angular#0.1.17 requires a peer of #angular-devkit/core#0.0.29 but none is installed. You must install peer dependencies yourself.
36106 warn tsickle#0.24.1 requires a peer of typescript#2.4.2 but none is installed. You must install peer dependencies yourself.
36110 verbose stack Error: node-sass#4.7.2 postinstall: `node scripts/build.js`
36111 verbose pkgid node-sass#4.7.2
36113 verbose Windows_NT 10.0.14393
36114 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
36115 verbose node v10.13.0
36116 verbose npm v6.4.1
36117 error code ELIFECYCLE
36118 error errno 1
36119 error node-sass#4.7.2 postinstall: `node scripts/build.js`
36119 error Exit status 1
36120 error Failed at the node-sass#4.7.2 postinstall script.
36120 error This is probably not a problem with npm. There is likely additional logging output above.
36121 verbose exit [ 1, true ]
this is my package.json:
{
"name": "front-angular",
"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.0.2",
"#angular/cdk": "5.0.0-rc0",
"#angular/common": "5.0.2",
"#angular/compiler": "5.0.2",
"#angular/core": "5.0.2",
"#angular/forms": "5.0.2",
"#angular/http": "5.0.2",
"#angular/material": "^5.2.0",
"#angular/material-moment-adapter": "^5.2.4",
"#angular/platform-browser": "5.0.2",
"#angular/platform-browser-dynamic": "5.0.2",
"#angular/router": "5.0.2",
"#ngx-translate/core": "8.0.0",
"#ngx-translate/http-loader": "2.0.0",
"#swimlane/ngx-charts": "7.0.1",
"#swimlane/ngx-datatable": "11.1.2",
"angular2-text-mask": "8.0.4",
"angular2-wizard": "0.4.0",
"bootstrap": "4.0.0-beta.2",
"compass-mixins": "0.12.10",
"devextreme": "^17.2.7",
"devextreme-angular": "^17.2.7",
"font-awesome": "4.7.0",
"jquery": "3.2.1",
"material-design-iconic-font": "2.2.0",
"mdi": "2.0.46",
"moment": "^2.22.0",
"multi-brand-colors": "1.1.3",
"ng2-password-strength-bar": "1.1.3",
"ng2-responsive": "0.8.4",
"ng2-search-filter": "0.3.1",
"ng2-validation": "4.2.0",
"ng2-webstorage": "2.0.0",
"ngbox": "0.0.15",
"ngx-bootstrap": "2.0.0-beta.8",
"ngx-ckeditor": "0.1.1",
"ngx-malihu-scrollbar": "1.2.2",
"ngx-perfect-scrollbar": "5.0.2",
"ngx-uploader": "4.2.1",
"node-sass": "4.7.2",
"sweetalert2": "^7.18.0",
"ts-helper": "0.0.1",
"web-animations-js": "2.3.1"
},
"devDependencies": {
"#angular/cli": "1.5.2",
"#angular/compiler-cli": "5.0.2",
"#angular/language-service": "5.0.2",
"#types/jasmine": "2.8.2",
"#types/jasminewd2": "2.0.2",
"#types/node": "8.0.53",
"angular2-perfect-scrollbar": "2.0.6",
"codelyzer": "4.0.1",
"copy-webpack-plugin": "4.2.3",
"jasmine-core": "2.8.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "1.7.0",
"karma-chrome-launcher": "2.2.0",
"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.2.0",
"ts-node": "3.3.0",
"tslint": "5.8.0",
"typescript": "2.6.1"
}
}
I'm using :
npm : v6.4.1
node: v10.13.0
Thank you.
You use Windows. Npm says windows build tools are not up to date. You have to upgrade the windows build tools. Try this command: npm install --global --production windows-build-tools
Also, take a look here. Maybe it can help: https://github.com/nodejs/node-gyp/issues/629#issuecomment-153196245

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

node.js jenkins npm install fails

I've been following the instructions here: http://code.tutsplus.com/tutorials/setting-up-continuous-integration-continuous-deployment-with-jenkins--cms-21511
When I create the production droplet all goes well. The new node.js works great and the npm install works.
When, however, I create the jenkins droplet, jenkins comes up fine, but the auto-install of the git package stops when it tries to find bower.
My package.json says:
{
"name": "mean",
"description": "Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js",
"version": "0.0.1",
"engines": {
"node": "0.10.x",
"npm": "1.4.x"
},
"scripts": {
"start": "grunt",
"test": "grunt test",
"postinstall": "bower install --config.interactive=false"
},
"dependencies": {
"express": "~4.10.1",
"express-session": "~1.9.1",
"body-parser": "~1.9.0",
"cookie-parser": "~1.3.2",
"compression": "~1.2.0",
"method-override": "~2.3.0",
"morgan": "~1.4.1",
"connect-mongo": "~0.4.1",
"connect-flash": "~0.1.1",
"helmet": "~0.5.0",
"consolidate": "~0.10.0",
"swig": "~1.4.1",
"mongoose": "~3.8.8",
"passport": "~0.2.0",
"passport-local": "~1.0.0",
"passport-facebook": "~1.0.2",
"passport-twitter": "~1.0.2",
"passport-linkedin": "~0.1.3",
"passport-google-oauth": "~0.1.5",
"passport-github": "~0.1.5",
"lodash": "~2.4.1",
"forever": "~0.11.0",
"bower": "~1.3.8",
"grunt-cli": "~0.1.13",
"glob": "~4.0.5",
"async": "~0.9.0",
"nodemailer": "~1.3.0",
"chalk": "~0.5",
"ejs": "~1.0.0",
"jquery": "~2.1.0",
"multer": "~0.1.7",
"busboy": "~0.2.9",
"connect-busboy":"~0.0.2",
"fs-extra":"~0.16.3"
},
"devDependencies": {
"grunt-concurrent": "~1.0.0",
"grunt-contrib-csslint": "^0.3.1",
"grunt-contrib-cssmin": "~0.10.0",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-uglify": "~0.6.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-env": "~0.4.1",
"grunt-karma": "~0.9.0",
"grunt-mocha-test": "~0.12.1",
"grunt-ng-annotate": "~0.4.0",
"grunt-node-inspector": "~0.1.3",
"grunt-nodemon": "~0.3.0",
"karma": "~0.12.0",
"karma-chrome-launcher": "~0.1.2",
"karma-coverage": "~0.2.0",
"karma-firefox-launcher": "~0.1.3",
"karma-jasmine": "~0.2.1",
"karma-phantomjs-launcher": "~0.1.2",
"karma-requirejs": "^0.2.2",
"load-grunt-tasks": "~1.0.0",
"requirejs": "^2.1.15",
"should": "~4.1.0",
"supertest": "~0.14.0"
}
}
And I get the error in the jenkins console log:
+ npm install
npm WARN package.json mean#0.0.1 No repository field.
> mean#0.0.1 postinstall /var/lib/jenkins/jobs/Paygevity/workspace
> bower install --config.interactive=false
sh: 1: bower: not found
npm ERR! Linux 3.13.0-43-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! mean#0.0.1 postinstall: `bower install --config.interactive=false`
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the mean#0.0.1 postinstall script 'bower install --config.interactive=false'.
npm ERR! This is most likely a problem with the mean package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! bower install --config.interactive=false
npm ERR! You can get their info via:
npm ERR! npm owner ls mean
npm ERR! There is likely additional logging output above.

Resources