Could not resolve dependency with sanity in nextjs app - node.js

I am trying to deploy my next.js project, but I keep getting the following error with everything I do:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: rcd_drone#0.1.0
npm ERR! Found: #sanity/client#3.4.1
npm ERR! node_modules/#sanity/client
npm ERR! #sanity/client#"^3.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #sanity/client#"^2.11.0" from next-sanity-image#3.2.1
npm ERR! node_modules/next-sanity-image
npm ERR! next-sanity-image#"^3.2.1" 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.
I also have the following dependencies:
{
"name": "rcd_drone",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"#babel/core": "^7.17.9",
"#sanity/client": "^3.2.0",
"#sanity/image-url": "^1.0.1",
"#stripe/stripe-js": "^1.25.0",
"canvas-confetti": "^1.5.1",
"next": "^12.1.0",
"next-sanity-image": "^3.2.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-hot-toast": "^2.2.0",
"react-icons": "^4.3.1",
"frontmatter-markdown-loader": "^3.6.3",
"stripe": "^8.209.0"
},
"devDependencies": {
"#babel/preset-react": "^7.16.7",
"eslint": "8.13.0",
"eslint-config-next": "12.1.4"
}
}

Try doing the npm install --legacy-peer-deps within the Vercel project deploy page.
When deploying your project, go to the "build and output" settings, then in the npm command input write: npm install --legacy-peer-deps.
Select the override radio button, then try deploying.

Try deleting node_modules folder and package-lock.json file and run:
npm install --legacy-peer-deps
This is going to make fresh installation of the modules.

Related

Angular dependency issue Windows to Linux

I'm trying to host an Angular application for a customer, but I can't get it to run on Linux. The customer develops on Windows and it works for him. I am using NodeJS 19.
Error message when npm install:
npm notice
npm notice New minor version of npm available! 9.2.0 -> 9.3.1
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.3.1>
npm notice Run `npm install -g npm#9.3.1` to update!
npm notice
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #agm/core#3.0.0-beta.0
npm ERR! Found: #angular/common#14.2.12
npm ERR! node_modules/#angular/common
npm ERR! #angular/common#"^14.2.0" from the root project
npm ERR! peer #angular/common#"^14.0.0 || ^15.0.0" from #angular/cdk#14.2.7
npm ERR! node_modules/#angular/cdk
npm ERR! #angular/cdk#"^14.2.4" from the root project
npm ERR! peer #angular/cdk#"14.2.7" from #angular/material#14.2.7
npm ERR! node_modules/#angular/material
npm ERR! #angular/material#"^14.2.4" from the root project
npm ERR! 1 more (#angular/material-moment-adapter)
npm ERR! 5 more (#angular/forms, #angular/material, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #angular/common#"^9.1.0 || ^10.0.0" from #agm/core#3.0.0-beta.0
npm ERR! node_modules/#agm/core
npm ERR! #agm/core#"^3.0.0-beta.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: #angular/common#10.2.5
npm ERR! node_modules/#angular/common
npm ERR! peer #angular/common#"^9.1.0 || ^10.0.0" from #agm/core#3.0.0-beta.0
npm ERR! node_modules/#agm/core
npm ERR! #agm/core#"^3.0.0-beta.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.
package.json
{
"name": "web-app",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"#agm/core": "^3.0.0-beta.0",
"#angular/animations": "^14.2.0",
"#angular/cdk": "^14.2.4",
"#angular/common": "^14.2.0",
"#angular/compiler": "^14.2.0",
"#angular/core": "^14.2.0",
"#angular/forms": "^14.2.10",
"#angular/material": "^14.2.4",
"#angular/material-moment-adapter": "^14.2.5",
"#angular/platform-browser": "^14.2.10",
"#angular/platform-browser-dynamic": "^14.2.0",
"#angular/router": "^14.2.10",
"#manekinekko/angular-web-bluetooth": "^11.2.2",
"#types/googlemaps": "^3.39.13",
"#types/maplibre-gl": "^1.14.0",
"#types/web-bluetooth": "^0.0.16",
"bootstrap": "^3.4.1",
"maplibre-gl": "^1.15.3",
"moment": "^2.29.4",
"rxjs": "~7.5.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "^14.2.2",
"#angular/cli": "~14.2.2",
"#angular/compiler-cli": "^14.2.0",
"#types/geojson": "^7946.0.10",
"#types/jasmine": "~4.0.0",
"jasmine-core": "~4.3.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"typescript": "~4.7.2"
}
}
I have already tried --force and --legacy-peer-deps but it still doesn't work.
A couple of things here.
First one of the packages you're using doesn't like the version of Angular you're using.
#agm/core#3.0.0-beta.0
This says that #agm/core#3.0.0-beta.0 is made for angular 9-10 and you're running 14.
npm ERR! Could not resolve dependency:
npm ERR! peer #angular/common#"^9.1.0 || ^10.0.0" from #agm/core#3.0.0-beta.0
npm ERR! node_modules/#agm/core
npm ERR! #agm/core#"^3.0.0-beta.0" from the root project
If you MUST use this version of #agm/core#3.0.0-beta.0 then you can run:
npm install --legacy-peer-deps
But this is not best practice. It's better to look for a version that works with your Angular version. A quick look at that package (npm view #agm/core versions --json) shows me that you have the latest version, since it's dependency is Angular 9-10 you might want to look for a replacement library that works with your version of Angular.
Second, you are using a development version of node, meaning that 19 is the latest but not considered stable by node.js- odd numbers for development, even numbers for production, current stable version is 18.13.0:
https://nodejs.org/en/download/
If you want to use multiple versions of node, you can use nvm (Node version manager)
Your version of node.js needs to match the installation version of node.js - so the Windows machine and the Linux machine need to both have the same version of node.js - that might be why it works in one place and not the other.

Why cant i install Angular Bootstrap?

Angular CLI: 14.2.3
Node: 16.15.1
Package Manager: npm 8.12.1
OS: darwin x64
I am installing angular bootstrap (trying to) getting the following error from NPM
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: tractapp#0.0.0
npm ERR! Found: #angular/core#14.2.2
npm ERR! node_modules/#angular/core
npm ERR! peer #angular/core#"14.2.2" from #angular/animations#14.2.2
npm ERR! node_modules/#angular/animations
npm ERR! peer #angular/animations#"^14.0.0 || ^15.0.0" from #angular/material#14.2.2
npm ERR! node_modules/#angular/material
npm ERR! #angular/material#"^14.2.2" from the root project
npm ERR! peerOptional #angular/animations#"14.2.2" from #angular/platform-browser#14.2.2
npm ERR! node_modules/#angular/platform-browser
npm ERR! peer #angular/platform-browser#"^12.0.0 || ^13.0.0 || ^14.0.0" from #angular/fire#7.4.1
npm ERR! node_modules/#angular/fire
npm ERR! #angular/fire#"^7.4.1" from the root project
npm ERR! 6 more (#angular/forms, #angular/material, ...)
npm ERR! 2 more (#swimlane/ngx-charts, the root project)
npm ERR! peer #angular/core#"^14.0.0 || ^15.0.0" from #angular/cdk#14.2.2
npm ERR! node_modules/#angular/cdk
npm ERR! peer #angular/cdk#"14.2.2" from #angular/material#14.2.2
npm ERR! node_modules/#angular/material
npm ERR! #angular/material#"^14.2.2" from the root project
npm ERR! peer #angular/cdk#">=12.0.0" from #swimlane/ngx-charts#20.1.0
npm ERR! node_modules/#swimlane/ngx-charts
npm ERR! #swimlane/ngx-charts#"^20.1.0" from the root project
npm ERR! 2 more (ng2-charts, the root project)
npm ERR! 16 more (#angular/common, #angular/compiler, #angular/fire, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! #ng-bootstrap/ng-bootstrap#"13.0.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: #angular/core#14.2.6
npm ERR! node_modules/#angular/core
npm ERR! peer #angular/core#"14.2.6" from #angular/forms#14.2.6
npm ERR! node_modules/#angular/forms
npm ERR! #angular/forms#"^14.2.0" from the root project
npm ERR! peer #angular/forms#"^14.1.0" from #ng-bootstrap/ng-bootstrap#13.0.0
npm ERR! node_modules/#ng-bootstrap/ng-bootstrap
npm ERR! #ng-bootstrap/ng-bootstrap#"13.0.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 errors and how these are stated is not my strong suit of understanding, would love if someone could help me out and point me in the right direction here.
Thanks!
Heres my package.json file aswell, im assuming its something in there by the way the error is formed/stated.
{
"name": "tractapp",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"#angular/animations": "^14.2.0",
"#angular/cdk": "^14.2.2",
"#angular/common": "^14.2.0",
"#angular/compiler": "^14.2.0",
"#angular/core": "^14.2.0",
"#angular/fire": "^7.4.1",
"#angular/forms": "^14.2.0",
"#angular/material": "^14.2.2",
"#angular/platform-browser": "^14.2.0",
"#angular/platform-browser-dynamic": "^14.2.0",
"#angular/router": "^14.2.0",
"#fortawesome/angular-fontawesome": "^0.11.1",
"#fortawesome/fontawesome-svg-core": "^6.2.0",
"#fortawesome/free-solid-svg-icons": "^6.2.0",
"#stripe/stripe-js": "^1.37.0",
"#sweetalert2/ngx-sweetalert2": "^12.0.1",
"#swimlane/ngx-charts": "^20.1.0",
"aos": "^2.3.4",
"apexcharts": "^3.35.5",
"chart.js": "^3.9.1",
"ng-apexcharts": "^1.7.1",
"ng2-charts": "^4.0.1",
"ngx-print": "^1.2.1",
"ngx-stripe": "^14.1.0",
"rxjs": "~7.5.0",
"stripe": "^10.11.0",
"sweetalert2": "^11.5.1",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "^14.2.3",
"#angular/cli": "~14.2.3",
"#angular/compiler-cli": "^14.2.0",
"#types/d3": "^7.4.0",
"#types/jasmine": "~4.0.0",
"jasmine-core": "~4.3.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"typescript": "~4.7.2"
}
}
Moving the comment to an answer per OP's request and so that the question can be marked resolved.
Looking at the Github releases page (accessed on 10/12/22 for v 13.0.0) the maximum support for the library currently is Angular 14.1, where as you are using 14.2.2. This seems to be a version compatibility issue (essentially the library is trying to pull an older version of Angular and you are getting a conflict)
You either have to downgrade you Angular version or use something else
npm update was perfect to me :D
Run npm update before installing ng bootstrap in your vs code terminal, that will fix it
I had the same problem when I added #angular/service-worker to my ionic project.
The angular version required by #angular/service-worker is different from the version installed at the beginning, and they conflict.
package-lock.json retains the version of angular that was originally installed
So, you can try to delete package-lock.json and rerun npm install

Error resolving node dependency with example package

I'm currently using Node v16.14.0 and npm v8.3.1 on my local machine. We've been pushing commits to azure devops which runs a ci/cd pipeline with a step that does npm install and npm run build:x. Never had any problems until recently. The yml file for the azure pipeline specifies 16.x for Node:
steps:
- task: NodeTool#0
inputs:
versionSpec: "16.x"
displayName: "Install Node.js
- script: |
npm install
npm run build:ourenv
displayName: "npm install and build"
The other day I pushed a few lines of code and I noticed the task installed Node 16.15.0. But it built and deployed normally. Then the next day I made a change and noticed it installed Node 16.15.1. This broke the build that ran fine on my local machine.
The fix to get the build working in the pipeline was to change the node version to 16.15.0 (the last successful build). But I'd like to get it to work with 16.x again.
The output of the pipeline build shows a problem resolving at least one dependency (package.json hasn't changed). Here's the output:
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: #typescript-eslint/eslint-plugin#5.16.0
npm WARN Found: #typescript-eslint/parser#4.31.0
npm WARN node_modules/#typescript-eslint/parser
npm WARN #typescript-eslint/parser#"^4.31.0" from the root project
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer #typescript-eslint/parser#"^5.0.0" from #typescript-eslint/eslint-plugin#5.16.0
npm WARN node_modules/#typescript-eslint/eslint-plugin
npm WARN #typescript-eslint/eslint-plugin#"^5.5.0" from eslint-config-react-app#7.0.0
npm WARN node_modules/eslint-config-react-app
npm WARN 1 more (eslint-plugin-jest)
npm WARN
npm WARN Conflicting peer dependency: #typescript-eslint/parser#5.27.1
npm WARN node_modules/#typescript-eslint/parser
npm WARN peer #typescript-eslint/parser#"^5.0.0" from #typescript-eslint/eslint-plugin#5.16.0
npm WARN node_modules/#typescript-eslint/eslint-plugin
npm WARN #typescript-eslint/eslint-plugin#"^5.5.0" from eslint-config-react-app#7.0.0
npm WARN node_modules/eslint-config-react-app
npm WARN 1 more (eslint-plugin-jest)
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #typescript-eslint/parser#4.31.0
npm ERR! Found: eslint#8.11.0
npm ERR! node_modules/eslint
npm ERR! peer eslint#"^7.5.0 || ^8.0.0" from #babel/eslint-parser#7.17.0
npm ERR! node_modules/#babel/eslint-parser
npm ERR! #babel/eslint-parser#"^7.16.3" from eslint-config-react-app#7.0.0
npm ERR! node_modules/eslint-config-react-app
npm ERR! eslint-config-react-app#"^7.0.0" from react-scripts#5.0.0
npm ERR! node_modules/react-scripts
npm ERR! react-scripts#"^5.0.0" from the root project
npm ERR! peer eslint#"^6.0.0 || ^7.0.0 || ^8.0.0" from #typescript-eslint/eslint-plugin#5.16.0
npm ERR! node_modules/#typescript-eslint/eslint-plugin
npm ERR! #typescript-eslint/eslint-plugin#"^5.5.0" from eslint-config-react-app#7.0.0
npm ERR! node_modules/eslint-config-react-app
npm ERR! eslint-config-react-app#"^7.0.0" from react-scripts#5.0.0
npm ERR! node_modules/react-scripts
npm ERR! react-scripts#"^5.0.0" from the root project
npm ERR! peerOptional #typescript-eslint/eslint-plugin#"^4.0.0 || ^5.0.0" from eslint-plugin-jest#25.7.0
npm ERR! node_modules/eslint-plugin-jest
npm ERR! eslint-plugin-jest#"^25.3.0" from eslint-config-react-app#7.0.0
npm ERR! node_modules/eslint-config-react-app
npm ERR! eslint-config-react-app#"^7.0.0" from react-scripts#5.0.0
npm ERR! node_modules/react-scripts
npm ERR! 16 more (#typescript-eslint/experimental-utils, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint#"^5.0.0 || ^6.0.0 || ^7.0.0" from #typescript-eslint/parser#4.31.0
npm ERR! node_modules/#typescript-eslint/parser
npm ERR! #typescript-eslint/parser#"^4.31.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: eslint#7.32.0
npm ERR! node_modules/eslint
npm ERR! peer eslint#"^5.0.0 || ^6.0.0 || ^7.0.0" from #typescript-eslint/parser#4.31.0
npm ERR! node_modules/#typescript-eslint/parser
npm ERR! #typescript-eslint/parser#"^4.31.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.
And my package.json looks like this:
{
"name": "myapp",
"version": "1.0.0",
"private": true,
"dependencies": {
"#emotion/react": "^11.6.0",
"#emotion/styled": "^11.6.0",
"#material-ui/core": "^4.12.3",
"#material-ui/icons": "^4.11.2",
"#material-ui/lab": "^4.0.0-alpha.60",
"#mui/icons-material": "^5.2.4",
"#mui/lab": "^5.0.0-alpha.60",
"#mui/material": "^5.5.2",
"#mui/styled-engine-sc": "^5.5.2",
"#mui/styles": "^5.5.1",
"#mui/types": "^7.1.0",
"#mui/x-data-grid": "^5.7.0",
"#mui/x-date-pickers": "^5.0.0-alpha.2",
"#popperjs/core": "^2.10.1",
"#testing-library/jest-dom": "^5.14.1",
"#testing-library/react": "^12.1.0",
"#testing-library/user-event": "^13.2.1",
"#types/history": "^4.7.9",
"#types/jest": "^27.0.1",
"#types/node": "^16.9.1",
"#types/react": "^17.0.20",
"#types/react-big-calendar": "^0.36.4",
"#types/react-dates": "^21.8.3",
"#types/react-dom": "^17.0.9",
"#types/react-router-dom": "^5.1.8",
"#types/reactstrap": "^8.7.1",
"#types/validator": "^13.7.1",
"#typescript-eslint/parser": "^4.31.0",
"array-move": "^4.0.0",
"axios": "^0.21.4",
"bootstrap": "^5.1.1",
"connected-react-router": "6.9.1",
"css-loader": "^6.2.0",
"date-fns": "^2.28.0",
"env-cmd": "^10.1.0",
"eslint-plugin-flowtype": "^5.9.2",
"eslint-plugin-import": "2.24.0",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-react": "7.24.0",
"history": "5.0.1",
"jquery": "^3.6.0",
"jshint": "^2.13.4",
"merge": "^2.1.1",
"moment": "^2.29.1",
"msal": "^1.4.12",
"oidc-react": "^1.5.1",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-big-calendar": "^0.39.4",
"react-dates": "^21.8.0",
"react-dom": "^17.0.2",
"react-draggable": "^4.4.4",
"react-localization": "^1.0.17",
"react-popper": "^2.2.5",
"react-query": "^3.23.2",
"react-quill": "^1.3.5",
"react-router": "^5.2.1",
"react-router-dom": "^6.0.2",
"react-scripts": "^5.0.0",
"react-sortable-hoc": "^2.0.0",
"reactstrap": "^8.10.0",
"styled-components": "^5.3.5",
"svgo": "^2.6.0",
"typescript": "^4.4.3",
"uuid": "^8.3.2",
"validator": "^13.7.0"
},
"scripts": {
"start:development": "env-cmd -f .env.development react-scripts start",
"start:staging": "env-cmd -f .env.staging react-scripts start",
"start:prod": "env-cmd -f .env.production react-scripts start",
"build:development": "env-cmd -f .env.development react-scripts build",
"build:staging": "env-cmd -f .env.staging react-scripts build",
"build:prod": "env-cmd -f .env.production react-scripts build",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"#types/uuid": "^8.3.4"
}
}
My package.json has a dep for #typescript-eslint/parser # v4.31.0. I ran npm list #typescript-eslint/parser and the output is:
myapp#0.1.0 D:\dev\repos\myapp
├── #typescript-eslint/parser#4.31.0
└─┬ react-scripts#5.0.0
└─┬ eslint-config-react-app#7.0.0
├─┬ #typescript-eslint/eslint-plugin#5.16.0
│ └── #typescript-eslint/parser#4.31.0 deduped invalid: "^5.0.0" from node_modules/#typescript-eslint/eslint-plugin
└── #typescript-eslint/parser#5.16.0
It appears to me that a dep of one of my dep requires a version of #typescript-eslint/parser that isn't compatible with the version in my project. Is that correct? And if so, what do I do to fix it (what does fixing the conflict upstream mean here)? And does the solution involve only upgrading this package, or upgrading/downgrading node too? Why is this apparent incompatibility only an issue in 16.15.1 and not in 16.15.0?
For someone with more experience, can you tell by looking at my package.json file what's wrong?
Thanks for any input.

How do I solve npm install issue after deleting node_modules

I am trying to clean out my react-native project's package to do a clean npm install on a MacOS based system (my windows system for Android development has no issues in cleaning up package versions).
I started seeing errors in the npm instals complaining version differences betwces are not compatible and list differences between versions of each package in "rook project" and node_modules/ directory.
I do the usual fix by removing package-lock.json, delete the node_modules directory and re-run npm install. from my project folder. It immediately made the same error complaints. The problem is this, there is no node_modules in my project folder as I deleted it. And it did not create a new node_modules directory.
Given this issue, how do I debug this and fix it? Questions I'd like to find out:
how do I tell npm to tell me what it thinks root project value is (full path)?
How to tell npm to tell me where the full path to the node_modules directory it seems to see?
Finally, how do I force npm to do the right thing and focus my my project's collaterals and not look outside the project folder as it appears to be doing?
Some of my thoughts. I don't understand why it is making a package cersion comparison between root project and node_modules?
Seems that nodde and npm are doing different things in MacOS environment than in my windows system environment -- I don't understand this.
Anyone here can help me understand what is going on and how to solve it?
The Error output here:
thomas#Presonus americanaradio % npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: AmericanaRadio#0.0.2
npm ERR! Found: react#16.14.0
npm ERR! node_modules/react
npm ERR! react#"^16.13.1" from the root project
npm ERR! peer react#"^16.8" from
#react-native-community/async-storage#1.12.1
npm ERR! node_modules/#react-native-community/async-storage
npm ERR! #react-native-community/async-storage#"^1.12.1" from the
root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"17.0.2" from react-native#0.66.4
npm ERR! node_modules/react-native
npm ERR! react-native#"^0.66.3" from the root project
npm ERR! peer react-native#">=0.59" from
#react-native-community/async-storage#1.12.1
npm ERR! node_modules/#react-native-community/async-storage
npm ERR! #react-native-community/async-storage#"^1.12.1" 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/thomas/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/thomas/.npm/_logs/2021-12-10T15_47_02_669Z-debug.log
thomas#Presonus americanaradio %
The package.json content here:
{END)
"name": "AmericanaRadio",
"version": "0.0.2",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"#react-native-community/async-storage": "^1.12.1",
"#react-native-community/checkbox": "^0.5.2",
"#react-native-community/masked-view": "^0.1.10",
"#react-native-community/slider": "^3.0.3",
"node-fetch": "^2.6.1",
"react": "^16.13.1",
"react-native": "^0.66.3",
"react-native-background-timer": "^2.4.1",
"react-native-elements": "^3.4.2",
"react-native-gesture-handler": "^1.9.0",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-reanimated": "^2.2.4",
"react-native-safe-area-context": "^3.1.9",
"react-native-screens": "^2.15.2",
"react-native-simple-survey": "^3.1.2",
"react-native-swift": "^1.2.1",
"react-native-vector-icons": "^8.0.0",
"react-native-version-check": "^3.4.2",
"react-native-version-info": "^1.1.0",
"react-native-webview": "^11.3.1",
"react-navigation": "^4.4.3",
"react-navigation-drawer": "^2.6.0",
"react-navigation-stack": "^2.10.2",
"react-usestateref": "^1.0.8",
"socket.io-client": "^4.4.0"
},
"devDependencies": {
"#babel/core": "^7.12.10",
"#babel/runtime": "^7.12.5",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "^7.18.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.64.0",
"react-test-renderer": "16.13.1"
},
"jest": {
"preset": "react-native"
}
}
~
(END)
As noted in my description, the node_modules directory was deleted and running npm install failed and did not create a nodes_modules directory. So the error messages are confusing as I have no packages in my project directory (americanaradio).
Thank you for taking a look at this and hopefully a solution can come out of ths.
First check what library is giving you an error and try to reinstall or update that version . Try deleting node modules also . Then do npm install.

Npm start doesn't work in an Angular 2 and Laravel 5 project

I am working on a Laravel 5.2 and Angular 2 project and I've just finished setting up angular but when running npm start, I get the following error :
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.4.7
npm ERR! npm v2.15.8
npm ERR! code ELIFECYCLE
npm ERR! # postinstall: `typings install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # postinstall script 'typings install'.
npm ERR! This is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! typings install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
Can you guys help me ?
This is the content of my package.json :
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch",
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
"lite": "lite-server",
"postinstall": "typings install",
"tsc": "tsc",
"tsc:w": "tsc -w",
"typings": "typings"
},
"devDependencies": {
"gulp": "^3.9.1",
"laravel-elixir": "^5.0.0",
"bootstrap-sass": "^3.0.0",
"concurrently": "^1.0.0",
"del": "^2.2.0"
},
"dependencies": {
"angular2": "2.0.0-beta.0",
"bootstrap-sass": "^3.0.0",
"elixir-typescript": "^1.1.2",
"es6-promise": "^3.0.2",
"es6-shim": "^0.33.3",
"laravel-elixir": "^4.0.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.0",
"systemjs": "0.19.6",
"zone.js": "0.5.10"
}
}
Your script is failing while trying to run 'typings install'.
1. Include typings in devDependencies
{
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.2.0",
"typescript": "^1.8.10",
"typings": "^1.0.4"
}
}
Run npm install
Create typings.json as below
{
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160602141332",
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
"node": "registry:dt/node#6.0.0+20160807145350"
}
}
npm start
if you still having issue install typings globally
npm install typings --global
I too face this problem i do the following steps
1. i uninstall nodejs and install the latest version.
2. close the command promt and open.
3. execute npm install
4. execute npm build(not nesessery)
5. execute npm start
This works for me.

Resources