Peer Dependency error while deploying to Vercel - deployment

I am trying to deploy my NextJS application onto Vercel but each time at the deploy stage, I am met with these errors and the deployment will fail:
Previous build cache not available
Cloning completed: 426.52ms
Running "vercel build"
Vercel CLI 28.6.0
Installing dependencies...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-typed#1.2.0
npm ERR! Found: react#18.2.0
npm ERR! node_modules/react
npm ERR! react#"18.2.0" from the root project
npm ERR! peer react#"^18.2.0" from next#13.0.5
npm ERR! node_modules/next
npm ERR! next#"13.0.5" from the root project
npm ERR! 3 more (react-dom, react-icons, styled-jsx)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.3.0" from react-typed#1.2.0
npm ERR! node_modules/react-typed
npm ERR! react-typed#"^1.2.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#16.14.0
npm ERR! node_modules/react
npm ERR! peer react#"^16.3.0" from react-typed#1.2.0
npm ERR! node_modules/react-typed
npm ERR! react-typed#"^1.2.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 /vercel/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /vercel/.npm/_logs/2022-12-02T16_42_09_037Z-debug-0.log
Error: Command "npm install" exited with 1
I have tried running npm install --legacy-peer-deps and tried redeploying onto Vercel, but the same issue persists. When I run this application on my localhost:3000 using npm run dev, the application renders fine. Anyone knows what I can do?
I have tried
npm install --legacy-peer-deps
and also pushing these changes onto my GitHub repository. When redeploying, the same issue still shows. I run
npm install --legacy-peer-deps
again, but this time, there are no more changes to be made.

you can override the installing command used by Vercel CLI, either by:
Going to Vercel Dashboard -> -> Settings -> General -> Scroll to Build & Development Settings and put npm install --legacy-peer-deps in Install Command
Creating vercel.json file in the root directory of your project that should contain:
// vercel.json
{
"installCommand": "npm install --legacy-peer-deps"
}
after that push and wait for deployment, it should go through this time
But I recommend looking for the cause of this issue. It seems like some dependency you're using is depending on react-typed, and the latter is not maintained anymore. It's better to seek an alternative

Related

Ionic Capcitor build Android unable to resolve dependency tree

I am receiving an error when attempting to run ionic capacitor build android (details below):
PS C:\Users\User\source\repos\imango\src> ionic capacitor build android
npm.cmd i -E #capacitor/android#latest
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: mango#0.0.1
npm ERR! Found: #capacitor/core#3.7.0
npm ERR! node_modules/#capacitor/core
npm ERR! #capacitor/core#"^3.5.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #capacitor/core#"^4.0.0" from #capacitor/android#4.0.1
npm ERR! node_modules/#capacitor/android
npm ERR! #capacitor/android#"4.0.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 C:\Users\User\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\User\AppData\Local\npm-cache_logs\2022-08-06T22_53_19_523Z-debug-0.log
[ERROR] An error occurred while running subprocess npm.
npm.cmd i -E #capacitor/android#latest exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
Your capacitor cli version is still set at 3.6.0 in your
devDependencies, try changing that to ^4.0.1 and clearing your
node_modules and removing your package-lock.json and run npm install
again.
Check this
Copied from her:
https://github.com/ionic-team/capacitor/issues/5812

ionic start with blank template giving error

I installed latest node, npm and angular
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: z#0.0.1
npm ERR! Found: #angular/compiler#11.0.9
npm ERR! node_modules/#angular/compiler
npm ERR! dev #angular/compiler#"~11.0.5" from the root project
npm ERR! peer #angular/compiler#"11.0.9" from #angular/compiler-cli#11.0.9
npm ERR! node_modules/#angular/compiler-cli
npm ERR! dev #angular/compiler-cli#"~11.0.5" from the root project
npm ERR! peer #angular/compiler-cli#"^11.0.0" from #angular-devkit/build-angular#0.1100.7
npm ERR! node_modules/#angular-devkit/build-angular
npm ERR! dev #angular-devkit/build-angular#"~0.1100.5" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #angular/compiler#"11.1.2" from #angular/localize#11.1.2
npm ERR! node_modules/#angular/localize
npm ERR! peerOptional #angular/localize#"^11.0.0" from #angular-devkit/build-angular#0.1100.7
npm ERR! node_modules/#angular-devkit/build-angular
npm ERR! dev #angular-devkit/build-angular#"~0.1100.5" 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 C:\Users\JatinKumar\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\JatinKumar\AppData\Local\npm-cache\_logs\2021-02-04T19_41_41_433Z-debug.log
[ERROR] An error occurred while running subprocess npm.
npm.cmd i exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
run npm install --force
and then
npm install --save-dev --force
Now you can run your project!

My bluemix app just stopped building. How can I fix it?

During today deploy (first from about a week) my application did not start. The changes were cosmetic and included only business logic, not configurations. What can be wrong? How can I fix this?
-----> Building dependencies
Installing node modules (package.json)
npm ERR! unpack Could not read data for bluemix-management-client#1.0.4
npm ERR! argv "/tmp/staged/app/vendor/node/bin/node" "/tmp/staged/app/vendor/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/staged/app/.npmrc"
npm ERR! node v5.12.0
npm ERR! npm v3.8.6
npm ERR! code E404
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/bluemix-management-client
npm ERR! 404 'bluemix-management-client' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'Atlas2'
npm ERR! 404 Note that you can also install from a
npm ERR! Please include the following file with any support request:
npm ERR! /tmp/staged/app/npm-debug.log
-----> Build failed
Resolved by myself by reapplying build pack via:
cf push -b sdk-for-nodejs_v3_6-20160715-0749
I've taken the build pack name from http://bpversions.mybluemix.net/.
Switch to npm >= 3.10.0 and the problem is resolved.

Leaflet map offline

I'm creating an app with Electron (the GitHub instrument to create apps with html and node.js).
This app will be used by some computer that they aren't connected to internet.
I need to show a map and collocate markers on it (I found Leaflet), but all maps service require internet.
With Open Street Maps I can export an osm file but I can't find a way to render it into Leaflet, because the only library for node (mapbox-gl-native-master) who do it require C++11 and it gives me error in installation:
$ npm install mapbox-gl-native
> mapbox-gl-native#3.2.1 preinstall /home/dpd-/node_modules/.staging/mapbox-gl-native-eb973ff7
> npm install node-pre-gyp
npm ERR! Linux 4.4.0-24-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "node-pre-gyp"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! Cannot read property 'target' of null
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/dpd-/node_modules/.staging/mapbox-gl-native-eb973ff7/npm-debug.log
npm WARN enoent ENOENT: no such file or directory, open '/home /dpd-/package.json'
npm WARN dpd- No description
npm WARN dpd- No repository field.
npm WARN dpd- No README data
npm WARN dpd- No license field.
npm ERR! Linux 4.4.0-24-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "mapbox-gl-native"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! mapbox-gl-native#3.2.1 preinstall: `npm install node-pre-gyp`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mapbox-gl-native#3.2.1 preinstall script 'npm install node-pre-gyp'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the mapbox-gl-native package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm install node-pre-gyp
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs mapbox-gl-native
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls mapbox-gl-native
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/dpd-/npm-debug.log
Take a look at either Kothic or Mapnik, Both should be more than capable of handling offline osm files. I guess Kothic will be a tad easier to implement (pure JS), since Mapnik essentially is a C++ library with a node.js interface. Additionally, Kothic claims easy integration with Leaflet, so I imagine this should suit you quite well.

Npm install directly from Github Error: ENOENT

I'm running an example from build-nodejs-npm-installation-package-scratch. Instead of uploading to npm repository I'm putting it on Github and trying to download it via npm instead. I run npm install git+https://github.com/t2wu/replaceme.git and got the following:
npm ERR! Error: ENOENT, chmod '/private/tmp/node_modules/replaceme_tim/replaceme.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "git+https://github.com/t2wu/replaceme.git"
npm ERR! cwd /private/tmp
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! path /private/tmp/node_modules/replaceme_tim/replaceme.js
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/tmp/npm-debug.log
npm ERR! not ok code 0
I have a package.json in there, I cannot figure out what is wrong.
EDIT: I can install Express OK, but I can't install my practice module
This happens due to missing permissions or unlinked files while npm was working. This topicc is also seen at github, here.
Try running with admin perms.