NPM Error when adding package as a peer dependency - node.js

I've 2 projects, where I use the same global components, and I decided to create a private npm package, when I moved my dependencies to peer dependencies it gives errors. I want to install packages without error, and when I try to install the npm package in my projects, I want to install it without npm i --legacy-peer-deps or npm i --force. My package.json file:
"dependencies": {
"react-helmet": "^6.1.0"
},
"devDependencies": {
"#babel/preset-env": "^7.14.1",
"#babel/preset-react": "^7.13.13",
"#rollup/plugin-babel": "^5.3.0",
"#rollup/plugin-commonjs": "^19.0.0",
"#rollup/plugin-node-resolve": "^13.0.0",
"#semantic-release/commit-analyzer": "8.0.1",
"#semantic-release/git": "9.0.0",
"#semantic-release/github": "7.2.3",
"#semantic-release/npm": "7.1.3",
"#semantic-release/release-notes-generator": "9.0.2",
"#storybook/addon-actions": "6.2.9",
"#storybook/addon-essentials": "6.2.9",
"#storybook/addon-info": "5.3.21",
"#storybook/addon-links": "6.2.9",
"#storybook/addons": "6.2.9",
"#storybook/react": "6.2.9",
"#testing-library/jest-dom": "5.11.9",
"#testing-library/react": "11.1.0",
"#testing-library/user-event": "12.6.3",
"#types/humps": "2.0.0",
"#types/jest": "26.0.15",
"#types/react-dom": "16.9.8",
"#types/react-helmet": "6.1.1",
"#types/react-router-dom": "5.1.7",
"#types/react-window": "1.8.2",
"#types/react-window-infinite-loader": "1.0.3",
"#typescript-eslint/eslint-plugin": "4.5.0",
"#typescript-eslint/parser": "4.5.0",
"eslint": "7.12.0",
"eslint-config-airbnb": "18.2.0",
"eslint-import-resolver-alias": "1.1.2",
"eslint-import-resolver-webpack": "0.13.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-import-helpers": "1.1.0",
"eslint-plugin-jest": "24.1.0",
"eslint-plugin-jsx-a11y": "6.4.0",
"eslint-plugin-react": "7.21.5",
"eslint-plugin-react-hooks": "4.2.0",
"file-loader": "6.1.1",
"html-webpack-plugin": "4.5.0",
"jest": "26.6.1",
"prettier": "2.2.1",
"rollup": "^2.50.4",
"rollup-plugin-cleaner": "^1.0.0",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-svg": "^2.0.0",
"rollup-plugin-typescript2": "^0.30.0",
"semantic-release": "17.4.2",
"size-limit": "4.10.2",
"style-loader": "2.0.0",
"ts-jest": "26.5.6",
"typescript-transform-paths": "2.2.3"
},
"peerDependencies": {
"#date-io/date-fns": "1.3.13",
"#hookform/resolvers": "1.3.0",
"#material-ui/core": "4.11.0",
"#material-ui/icons": "4.11.2",
"#material-ui/lab": "4.0.0-alpha.57",
"#material-ui/pickers": "3.2.10",
"#size-limit/preset-small-lib": "4.10.2",
"clsx": "1.1.1",
"date-fns": "2.17.0",
"humps": "2.0.1",
"i18next": "19.8.7",
"keycloak-js": "^12.0.4",
"memoize-one": "^5.1.1",
"notistack": "^1.0.6",
"react": ">=17.0.1",
"react-dom": "17.0.1",
"react-hook-form": "6.9.6",
"react-hotkeys-hook": "^3.2.1",
"react-i18next": "11.8.5",
"react-if": "^4.0.1",
"react-router": "5.2.0",
"react-router-dom": "5.2.0",
"react-virtualized-auto-sizer": "^1.0.4",
"react-window": "1.8.5",
"react-window-infinite-loader": "^1.0.7",
"yup": "0.29.3"
}
NPM ERROR:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: #picsart/pa-backoffice-shared#1.0.0
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! peer react#">=16.0.0" from the root project
npm ERR! peer react#">=16.3.0" from react-helmet#6.1.0
npm ERR! node_modules/react-helmet
npm ERR! react-helmet#"^6.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8.0" from react-hook-form#6.9.6
npm ERR! node_modules/react-hook-form
npm ERR! peer react-hook-form#"6.9.6" from the root project
npm ERR! peer react-hook-form#">=6.6.0" from #hookform/resolvers#1.3.0
npm ERR! node_modules/#hookform/resolvers
npm ERR! peer #hookform/resolvers#"1.3.0" from the root project
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 /Users/tikopicsart/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/tikopicsart/.npm/_logs/2021-06-02T07_25_09_846Z-debug.log
How can I resolve it without npm i --legacy-peer-deps or npm i --force.

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

React-native: Error with npm install; dependency issues

This is the issue I am facing when running npm install to install dependencies for the application I am trying to run. I'm new to Node and React:
> cd core && npm ci
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-native-fs#2.18.0
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! peer react#"17.0.2" from the root project
npm ERR! peer react#"^17.0.2" from #aries-framework/react-hooks#0.3.0
npm ERR! node_modules/#aries-framework/react-hooks
npm ERR! peer #aries-framework/react-hooks#"^0.3.0" from the root project
npm ERR! 31 more (#expo/react-native-action-sheet, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-windows#"*" from react-native-fs#2.18.0
npm ERR! node_modules/react-native-fs
npm ERR! peer react-native-fs#"^2.16.6" from the root project
npm ERR! peer react-native-fs#"^2.18.0" from #aries-framework/react-native#0.2.2
npm ERR! node_modules/#aries-framework/react-native
npm ERR! peer #aries-framework/react-native#"^0.2.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#18.1.0
npm ERR! node_modules/react
npm ERR! peer react#"18.1.0" from react-native-windows#0.70.5
npm ERR! node_modules/react-native-windows
npm ERR! peer react-native-windows#"*" from react-native-fs#2.18.0
npm ERR! node_modules/react-native-fs
npm ERR! peer react-native-fs#"^2.16.6" from the root project
npm ERR! 1 more (#aries-framework/react-native)
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 /Users/samueloneill/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/samueloneill/.npm/_logs/2022-11-08T11_54_30_572Z-debug-0.log
ERROR: "ci:core" exited with 1.
ERROR: "ci:all" exited with 1.
npm ERR! code 1
npm ERR! path /Users/samueloneill/aries-mobile-agent-react-native
npm ERR! command failed
npm ERR! command sh -c run-s ci:all build:all
I've tried npm install --legacy-peer-deps resulting in a ✖ Failed to build definition files error.
Any help would be greatly appreciated!!
Edit: here are the dependencies from the package.json
"#aries-framework/core": "^0.2.2",
"#aries-framework/react-hooks": "^0.3.0",
"#aries-framework/react-native": "^0.2.0",
"#formatjs/intl-datetimeformat": "^4.2.3",
"#formatjs/intl-displaynames": "^5.2.3",
"#formatjs/intl-getcanonicallocales": "^1.7.3",
"#formatjs/intl-listformat": "^6.3.3",
"#formatjs/intl-locale": "^2.4.37",
"#formatjs/intl-numberformat": "^7.2.3",
"#formatjs/intl-pluralrules": "^4.1.3",
"#formatjs/intl-relativetimeformat": "^9.2.3",
"#react-native-async-storage/async-storage": "^1.12.1",
"#react-native-community/masked-view": "^0.1.11",
"#react-native-community/netinfo": "^9.3.0",
"#react-navigation/bottom-tabs": "^6.0.9",
"#react-navigation/core": "^6.1.0",
"#react-navigation/devtools": "^6.0.8",
"#react-navigation/native": "^6.0.6",
"#react-navigation/stack": "^6.0.11",
"axios": "^0.21.0",
"i18next": "^21.4.0",
"indy-sdk-react-native": "^0.2.2",
"lodash.flatten": "^4.4.0",
"lodash.startcase": "^4.4.0",
"query-string": "^7.0.1",
"react": "17.0.2",
"react-i18next": "^11.13.0",
"react-native": "0.66.5",
"react-native-animated-pagination-dots": "^0.1.72",
"react-native-argon2": "^2.0.1",
"react-native-bouncy-checkbox": "^3.0.5",
"react-native-camera": "^3.31.1",
"react-native-collapsible": "^1.6.0",
"react-native-config": "^1.4.2",
"react-native-confirmation-code-field": "^7.3.0",
"react-native-device-info": "^8.4.9",
"react-native-encrypted-storage": "^4.0.2",
"react-native-fs": "^2.16.6",
"react-native-gesture-handler": "^1.10.3",
"react-native-get-random-values": "^1.7.0",
"react-native-gifted-chat": "^0.16.3",
"react-native-keychain": "^8.1.1",
"react-native-localize": "^2.1.5",
"react-native-qrcode-svg": "^6.0.6",
"react-native-reanimated": "^2.2.4",
"react-native-safe-area-context": "^3.2.0",
"react-native-scalable-image": "^1.1.0",
"react-native-screens": "^3.3.0",
"react-native-splash-screen": "^3.2.0",
"react-native-svg": "^12.1.1",
"react-native-toast-message": "^2.0.1",
"react-native-uuid": "^2.0.1",
"react-native-vector-icons": "^8.1.0",
"uuid": "^8.1.0"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.12.5",
"#commitlint/cli": "^11.0.0",
"#react-native-community/eslint-config": "^2.0.0",
"#testing-library/jest-native": "^4.0.4",
"#testing-library/react-native": "^9.0.0",
"#types/indy-sdk-react-native": "npm:#types/indy-sdk#^1.16.18",
"#types/jest": "^27.4.0",
"#types/lodash.flatten": "^4.4.6",
"#types/lodash.startcase": "^4.4.6",
"#types/react": "^16.14.4",
"#types/react-native": "^0.63.50",
"#types/react-native-vector-icons": "^6.4.6",
"#types/react-test-renderer": "^16.9.5",
"#typescript-eslint/eslint-plugin": "^4.20.0",
"#typescript-eslint/parser": "^4.33.0",
"babel-jest": "^27.5.1",
"babel-plugin-module-resolver": "^4.1.0",
"commitlint": "^11.0.0",
"eslint": "^7.14.0",
"eslint-import-resolver-typescript": "^2.5.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-prettier": "^3.3.1",
"husky": "^7.0.0",
"jest": "^27.5.1",
"lint-staged": "^11.2.6",
"metro-react-native-babel-preset": "^0.66.2",
"mockdate": "^3.0.5",
"node-notifier": "^10.0.1",
"patch-package": "^6.4.4",
"prettier": "^2.1.2",
"react-native-builder-bob": "^0.18.2",
"react-native-flipper": "^0.154.0",
"react-native-svg-transformer": "^0.14.3",
"react-test-renderer": "17.0.2",
"ts-jest": "^27.1.3",
"typescript": "^4.2.2"
So here is what happens
tested on node v16.18.1/npm 8.19.2
you have react-native-fs which pools react-native-windows#0.70.5 you can fix it by adding "react-native-windows": "0.66.5" into your dependencies (same version as your react-native).
then you'll face issue with "react-native-scalable-image": "^1.1.0" which demands "react": "^16.8.3". So either get rid of react-native-scalable-image or ask maintainer to be less strict on react version
UPDATE 7 Dec 2022:
I had to
patch app/package.json and core/package.json
remove app/package-lock.json and core/package-lock.json
run npm i in app and core
After that dependencies can be installed however build still fails.
I must say the project has sick dependencies and requires a lot of attention to fix them
Index: app/package.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/package.json b/app/package.json
--- a/app/package.json (revision faffa2806a8980b0655a35a94fc7cabd32699922)
+++ b/app/package.json (revision d8f3ceca67e237fea1090451412e7297c5bb14bb)
## -40,6 +40,7 ##
"react": "17.0.2",
"react-i18next": "11.13.0",
"react-native": "0.66.5",
+ "react-native-windows": "0.66.5",
"react-native-animated-pagination-dots": "0.1.72",
"react-native-argon2": "2.0.1",
"react-native-bouncy-checkbox": "^3.0.5",
## -58,7 +59,6 ##
"react-native-qrcode-svg": "6.1.1",
"react-native-reanimated": "^2.2.4",
"react-native-safe-area-context": "3.3.2",
- "react-native-scalable-image": "^1.1.0",
"react-native-screens": "3.7.2",
"react-native-splash-screen": "3.3.0",
"react-native-svg": "12.1.1",
Index: core/package.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/core/package.json b/core/package.json
--- a/core/package.json (revision faffa2806a8980b0655a35a94fc7cabd32699922)
+++ b/core/package.json (revision d8f3ceca67e237fea1090451412e7297c5bb14bb)
## -48,6 +48,7 ##
"react": "17.0.2",
"react-i18next": "^11.13.0",
"react-native": "0.66.5",
+ "react-native-windows": "0.66.5",
"react-native-animated-pagination-dots": "^0.1.72",
"react-native-argon2": "^2.0.1",
"react-native-bouncy-checkbox": "^3.0.5",
## -66,7 +67,6 ##
"react-native-qrcode-svg": "^6.0.6",
"react-native-reanimated": "^2.2.4",
"react-native-safe-area-context": "^3.2.0",
- "react-native-scalable-image": "^1.1.0",
"react-native-screens": "^3.3.0",
"react-native-splash-screen": "^3.2.0",
"react-native-svg": "^12.1.1",

Error while installing node modules in reactjs

Getting the below shown error I tried to install node modules using npm i command for my react js project
D:\Rev>npm i
> node-sass#4.12.0 install D:\Rev\node_modules\node-sass
> node scripts/install.js
Cached binary found at C:\Users\admin\AppData\Roaming\npm-cache\node-sass\4.12.0\win32-x64-64_binding.node
> node-sass#4.12.0 postinstall D:\Rev\node_modules\node-sass
> node scripts/build.js
Binary found at D:\Rev\node_modules\node-sass\vendor\win32-x64-64\binding.node
Testing binary
Binary is fine
> react-vertical-timeline-component#2.5.0 postinstall D:\Rev\node_modules\react-vertical-timeline-component
> node lib/post_install.js
> example-project#1.0.0 postinstall D:\Rev
> set NODE_ENV=production && npm run build-prod
> example-project#1.0.0 build-prod D:\Rev
> webpack --mode production --config webpack/webpack.production.config.js --progress --colors
D:\Rev\node_modules\webpack-cli\bin\config-yargs.js:89
describe: optionsSchema.definitions.output.properties.path.description,
^
TypeError: Cannot read property 'properties' of undefined
at module.exports (D:\Rev\node_modules\webpack-cli\bin\config-yargs.js:89:48)
at D:\Rev\node_modules\webpack-cli\bin\webpack.js:60:27
at Object.<anonymous> (D:\Rev\node_modules\webpack-cli\bin\webpack.js:515:3)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! example-project#1.0.0 build-prod: `webpack --mode production --config webpack/webpack.production.config.js --progress --colors`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the example-project#1.0.0 build-prod 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\admin\AppData\Roaming\npm-cache\_logs\2019-09-27T08_52_21_812Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! example-project#1.0.0 postinstall: `set NODE_ENV=production && npm run build-prod`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the example-project#1.0.0 postinstall 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\admin\AppData\Roaming\npm-cache\_logs\2019-09-27T08_52_21_942Z-debug.log
The package.json is as follows:
{
"name": "example-project",
"version": "1.0.0",
"description": "",
"main": "bundle.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev-server": "set NODE_ENV=development && webpack-dev-server --mode development --config webpack/webpack.config.js --progress --colors",
"build": "set NODE_ENV=development && webpack --config webpack/webpack.production.config.js --progress --colors",
"build-prod": "webpack --mode production --config webpack/webpack.production.config.js --progress --colors",
"postinstall": "set NODE_ENV=production && npm run build-prod"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.3",
"babel-loader": "^7.1.4",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"css-loader": "^0.28.11",
"eslint": "^4.19.1",
"eslint-loader": "^2.0.0",
"eslint-plugin-react": "^7.8.2",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"node-sass": "^4.9.0",
"react-collapsible": "^2.2.0",
"sass-loader": "^7.0.1",
"style-loader": "^0.21.0",
"webpack": "^4.8.3",
"webpack-cli": "^2.1.5",
"webpack-dev-server": "^3.1.4",
"webpack-merge": "^4.1.2"
},
"dependencies": {
"axios": "^0.18.0",
"babel-polyfill": "^6.26.0",
"babel-preset-react": "^6.24.1",
"classnames": "^2.2.5",
"dnd-core": "^3.0.2",
"file-loader": "^1.1.11",
"file-system": "^2.2.2",
"foundation-sites": "^6.4.3",
"gatsby-plugin-glamor": "^1.6.13",
"glamor": "^2.20.40",
"history": "^4.7.2",
"jquery": "^3.3.1",
"lodash": "^4.17.10",
"moment": "^2.22.1",
"qs": "^6.5.2",
"raf": "^3.4.1",
"rc-tree": "^1.11.4",
"react": "^16.3.2",
"react-autocomplete": "^1.8.1",
"react-column-resizer": "^1.1.8",
"react-datepicker": "^1.5.0",
"react-dialog": "^1.0.2",
"react-dnd": "^3.0.2",
"react-dnd-html5-backend": "^2.6.0",
"react-dom": "^16.3.2",
"react-dropzone": "^4.2.9",
"react-html-table-to-excel": "^2.0.0",
"react-idle-timer": "^3.0.0",
"react-js-pagination": "^3.0.2",
"react-redux": "^5.0.7",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-router-redux": "^5.0.0-alpha.9",
"react-simple-dropdown": "^3.2.0",
"react-sortable-hoc": "^0.8.4",
"react-toastify": "^4.0.1",
"react-tooltip": "^3.10.0",
"react-transition-group": "^2.3.1",
"react-vertical-timeline-component": "^2.0.6",
"react-widgets": "^4.2.6",
"redux": "^3.7.2",
"redux-form": "^7.3.0",
"redux-thunk": "^2.2.0",
"uglifyjs-webpack-plugin": "^1.2.5",
"universal-cookie": "^2.1.2",
"url-loader": "^1.0.1"
}
}
How can I solve this issue?
Can you try to remove totally local node_modules
Then call
npm cache verify
or
npm cache clean
https://docs.npmjs.com/cli/cache.html
Then try to npm i again

npm dependency issue when installing... well, pretty much anything

Suddenly, this is happening:
$ npm install history
npm ERR! Linux 3.13.0-76-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "history"
npm ERR! node v4.4.0
npm ERR! npm v2.14.20
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package history#1.13.1 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer react-router#1.0.3 wants history#^1.17.0
...when I try to install, well, pretty much anything. I've tried to install react-bootstrap, got this error, and tried to upgrade history. I'm not sure what to do here.
I've tried npm i -S history#1.17.0 to no avail. Same error.
Here's my package.json:
"dependencies": {
"bootstrap-loader": "1.0.9",
"bootstrap-sass": "3.3.6",
"connect-history-api-fallback": "1.1.0",
"css-loader": "0.23.1",
"font-awesome": "4.5.0",
"font-awesome-webpack": "0.0.4",
"node-sass": "3.4.2",
"object-assign": "4.0.1",
"react": "0.14.7",
"react-dom": "0.14.7",
"react-redux": "4.4.0",
"react-router": "2.0.0",
"redux": "3.3.1",
"redux-api-middleware": "1.0.1",
"redux-thunk": "2.0.1",
"resolve-url-loader": "1.4.3",
"sass-loader": "3.2.0",
"style-loader": "0.13.0",
"url-loader": "0.5.7"
},
"devDependencies": {
"babel-cli": "6.5.1",
"babel-core": "6.5.1",
"babel-eslint": "5.0.0",
"babel-loader": "6.2.3",
"babel-plugin-react-display-name": "2.0.0",
"babel-plugin-react-transform": "2.0.0",
"babel-preset-es2015": "6.5.0",
"babel-preset-react": "6.5.0",
"babel-preset-stage-1": "6.5.0",
"browser-sync": "2.11.1",
"chai": "3.4.1",
"cheerio": "0.19.0",
"colors": "1.1.2",
"cross-env": "1.0.7",
"css-loader": "0.23.1",
"eslint": "2.2.0",
"eslint-loader": "1.3.0",
"eslint-plugin-react": "4.0.0",
"extract-text-webpack-plugin": "1.0.1",
"file-loader": "0.8.5",
"mocha": "2.3.4",
"node-sass": "3.4.2",
"parallelshell": "2.0.0",
"react-transform-catch-errors": "1.0.1",
"react-transform-hmr": "1.0.1",
"redbox-react": "1.2.0",
"rimraf": "2.5.0",
"sass-loader": "3.1.2",
"style-loader": "0.13.0",
"watch": "0.17.1",
"webpack": "1.12.11",
"webpack-dev-middleware": "1.4.0",
"webpack-hot-middleware": "2.6.0",
"yargs": "3.32.0"
},
Any help appreciated.
Looks like some versions had their wires crossed somehow. Ended up removing my node_modules directory rm -r node_modules and reinstalling npm install and that fixed it.

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