logs Heroku push rejected, failed to compile Node.js app - reactjs

-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version 16.x...
Downloading and installing node 16.16.0...
Using default npm version: 8.11.0
-----> Installing dependencies
Installing node modules
added 120 packages, and audited 121 packages in 8s
15 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
-----> Build
Running heroku-postbuild
> newportfolio#0.1.0 heroku-postbuild
> NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-typical#0.1.3
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"^17.0.2" from the root project
npm ERR! peer react#">=16.x" from #fortawesome/react-fontawesome#0.1.19
npm ERR! node_modules/#fortawesome/react-fontawesome
npm ERR! #fortawesome/react-fontawesome#"^0.1.14" from the root project
npm ERR! 4 more (#testing-library/react, react-dom, react-scripts, react-toastify)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^15.0.0 || ^16.0.0" from react-typical#0.1.3
npm ERR! node_modules/react-typical
npm ERR! react-typical#"^0.1.3" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#16.14.0
npm ERR! node_modules/react
npm ERR! peer react#"^15.0.0 || ^16.0.0" from react-typical#0.1.3
npm ERR! node_modules/react-typical
npm ERR! react-typical#"^0.1.3" 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 /tmp/npmcache.u5EXI/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.u5EXI/_logs/2022-07-10T18_18_44_784Z-debug-0.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- Node version not specified in package.json
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed

The error message is straightforward here:
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"^17.0.2" from the root project
npm ERR! peer react#">=16.x" from #fortawesome/react-fontawesome#0.1.19
npm ERR! node_modules/#fortawesome/react-fontawesome
npm ERR! #fortawesome/react-fontawesome#"^0.1.14" from the root project
npm ERR! 4 more (#testing-library/react, react-dom, react-scripts, react-toastify)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^15.0.0 || ^16.0.0" from react-typical#0.1.3
npm ERR! node_modules/react-typical
npm ERR! react-typical#"^0.1.3" from the root project
Your package.json requires react#"^17.0.2" but react-typical requires react#"^15.0.0 || ^16.0.0" ; so you have a conflict between the versions of React.
To solve this, try to update the version of your libraries. New versions can add compatibilities with new versions. If not, see if this library is necessary for your project.
Edit
react-typical does not require the last version of React. So, you have to fork this library to use the last version of React or you may simply drop this library. The last commit has been published in 2019, this library is maybe not longer maiained.

Related

Dependency error when running React on AWS Amplify

Recently after installing react-collapsed package with npm there was no issue with running on localhot and everything was as expected. However after building on AWS Amplify I encountered the following dependency error. I've tried npm ci to clean up the dependencies with no luck. Any tips would be greatly appreciated!
2023-02-03T05:34:40.280Z [WARNING]: ERR! ERESOLVE could not resolve
npm ERR!
2023-02-03T05:34:40.280Z [WARNING]: npm ERR! While resolving: react-collapsed#3.6.0
npm ERR! Found: react#18.2.0
npm ERR! node_modules/react
npm ERR!
2023-02-03T05:34:40.281Z [WARNING]: react#"^18.2.0" from the root project
npm ERR! peer react#"^18.2.0" from react-dom#18.2.0
npm ERR! node_modules/react-dom
npm ERR! react-dom#"^18.2.0" from the root project
npm ERR! 3 more (react-router, react-router-dom, react-scripts)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8 || ^17" from react-collapsed#3.6.0
2023-02-03T05:34:40.281Z [WARNING]: npm ERR! node_modules/react-collapsed
npm ERR! react-collapsed#"^3.6.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#17.0.2
npm ERR! node_modules/react
npm ERR! peer react#"^16.8 || ^17" from react-collapsed#3.6.0
npm ERR! node_modules/react-collapsed
npm ERR! react-collapsed#"^3.6.0" from the root project
npm ERR!
2023-02-03T05:34:40.281Z [WARNING]:
Tried uninstalling which reverted the issue, npm ci didn't resolve the issue
After some digging it appears that react-collapsed removed support for react 18 temporarily: https://github.com/roginfarrer/collapsed/pull/120. Rolling back to react-collapsed#3.0 solved the issue

React Project build fails on Aws amplify while updated from React v16 to v18

I have recently updated my react project from React v16 to v18. It builds on my local machine using npm run build. But after deploying in Aws Amplify to build it gives error! Throwing whole log below. Is it something from npm error or While resolving: #material-ui/core#4.12.4 on the log showed so?
2022-12-14T10:37:14.709Z [INFO]: # Executing command: npm install
2022-12-14T10:37:19.882Z [WARNING]: npm ERR! code
2022-12-14T10:37:19.884Z [WARNING]: ERESOLVE
2022-12-14T10:37:19.904Z [WARNING]: npm
2022-12-14T10:37:19.904Z [WARNING]: ERR! ERESOLVE could not resolve
npm ERR!
npm ERR!
2022-12-14T10:37:19.904Z [WARNING]: While resolving: #material-ui/core#4.12.4
npm ERR! Found: react#18.2.0
npm ERR! node_modules/react
npm ERR! react#"^18.2.0" from the root project
2022-12-14T10:37:19.904Z [WARNING]: npm ERR! peerOptional react#"^16.8.0 || ^17.0.0 ||
^18.0.0" from #apollo/client#3.7.2
npm ERR! node_modules/#apollo/client
npm ERR! #apollo/client#"^3.3.14" from the root
project
npm ERR! #apollo/client#"latest" from #apollo/react-
components#4.0.0
npm ERR! node_modules/#apollo/react-components
npm ERR! #apollo/react-components#"^4.0.0-beta.2"
from the root project
npm ERR! 33 more (#aws-amplify/ui-react, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8.0 || ^17.0.0" from #material-
ui/core#4.12.4
2022-12-14T10:37:19.905Z [WARNING]: npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"^4.11.3" from the root
project
npm ERR!
npm ERR! Conflicting peer dependency: react#17.0.2
npm ERR! node_modules/react
npm ERR! peer react#"^16.8.0 || ^17.0.0" from
#material-ui/core#4.12.4
npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"^4.11.3" 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
2022-12-14T10:37:19.905Z [WARNING]: ERR! to accept an incorrect (and potentially broken)
dependency resolution.
npm ERR!
npm ERR! See /root/.npm/eresolve-report.txt for a full
report.
2022-12-14T10:37:19.906Z [WARNING]:
2022-12-14T10:37:19.906Z [WARNING]: npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-12-14T10_37_14_924Z-
debug-0.log
2022-12-14T10:37:19.918Z [ERROR]: !!! Build failed
2022-12-14T10:37:19.918Z [ERROR]: !!! Non-Zero Exit Code detected
2022-12-14T10:37:19.918Z [INFO]: # Starting environment caching...
2022-12-14T10:37:19.918Z [INFO]: # Uploading environment cache artifact...
2022-12-14T10:37:20.001Z [INFO]: # Uploaded environment cache artifact
2022-12-14T10:37:20.001Z [INFO]: # Environment caching completed
Terminating logging...
Can anyone help me out? Thanks in advance.
If you use React 18, you should use it with #mui/material v5 instead of #material-ui/core.
https://mui.com/material-ui/getting-started/overview/

npm ERR code ERESOLVE facing this issue while trying to install react packages

I have materials-ui already installed and when i tried to install other react packages im getting this error and nothing related to npm is working properly please help
PS
C:\Users\panna\OneDrive\Desktop\forms\google_form> npm install #mui/lab
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #material-ui/core#4.12.4
npm ERR! Found: react#18.2.0
npm ERR! node_modules/react
npm ERR! peer react#"^17.0.0 || ^18.0.0" from #mui/base#5.0.0-alpha.105
npm ERR! node_modules/#mui/base
npm ERR! #mui/base#"5.0.0-alpha.105" from #mui/material#5.10.13
npm ERR! node_modules/#mui/material
npm ERR! #mui/material#"^5.10.13" from the root project
npm ERR! 1 more (#mui/lab)
npm ERR! #mui/base#"5.0.0-alpha.105" from #mui/lab#5.0.0-alpha.107
npm ERR! node_modules/#mui/lab
npm ERR! #mui/lab#"*" from the root project
npm ERR! peer react#"^17.0.0 || ^18.0.0" from #mui/material#5.10.13
npm ERR! node_modules/#mui/material
npm ERR! #mui/material#"^5.10.13" from the root project
npm ERR! peer #mui/material#"^5.0.0" from #mui/lab#5.0.0-alpha.107
npm ERR! node_modules/#mui/lab
npm ERR! #mui/lab#"*" from the root project
npm ERR! 11 more (#mui/private-theming, #mui/styled-engine, #mui/system, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8.0 || ^17.0.0" from #material-ui/core#4.12.4
npm ERR! node_modules/#material-ui/core
npm ERR! peer #material-ui/core#"^4.0.0" from #material-ui/icons#4.11.3
npm ERR! node_modules/#material-ui/icons
npm ERR! #material-ui/icons#"^4.11.3" from the root project
npm ERR! #material-ui/core#"^4.12.4" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#17.0.2
npm ERR! node_modules/react
npm ERR! peer react#"^16.8.0 || ^17.0.0" from #material-ui/core#4.12.4
npm ERR! node_modules/#material-ui/core
npm ERR! node_modules/#material-ui/icons
npm ERR! #material-ui/icons#"^4.11.3" from the root project
npm ERR! #material-ui/core#"^4.12.4" 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\panna\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\panna\AppData\Local\npm-cache\_logs\2022-11-13T18_48_18_070Z-debug-0.log
og
I tried uninstalling materials ui and many more thing whatever was availble on the net but couldnt find anything similar , it is my first time using reacts packages please help
This is because you are using React 18 with MUI v4
you can choose one of these approaches:
Update your MUI to v5
or
Downgrade your React Version to 17
or if you want to keep these version just simply use this flag --legacy-peer-deps
for example: npm install #mui/lab --legacy-peer-deps
then you can install everything
But Preferably Update your MUI to version 5.

I do I resolve the package.jason file error?

Why am I having the below error
PS C:\Users\USER\Desktop\Shareme\shareme_frontend> npm install #sanity/client #sanity/image-url react-google-login react-icons react-loader-spinner react-masonry-css react-router-dom uuid
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: shareme_frontend#0.1.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!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16 || ^17" from react-google-login#5.2.2
npm ERR! node_modules/react-google-login
npm ERR! react-google-login#"*" 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-06-29T15_11_18_949Z-debug-0.log
react-google-login is not updated to the latest react v18.
Either wait for an update, downgrade react to v17, or use --force flag.
npm i react-google-login --force
Note that by using --force, there is no guarantee that this package will work with v18 of react
react-google-login#5.2.2 is not compatible with react 18 version as 5.2.2 is published year ago as per npm page.
It is still looking for react version of 17 / 16.
Below error block will tell you this:
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16 || ^17" from react-google-login#5.2.2
You can downgrade your react for this specific project via :
deleting node_modules
run npm cache clean
manually update your package.json to change version of react to 17
run npm install

Unable to start a project with Gatsby+Ghost

I'm new with Gatsby and I am trying to start a project based on Gatsby + Ghost but I can solve this problem that appears right away I execute the command from the official github page:
$ gatsby new gatsby-starter-ghost https://github.com/TryGhost/gatsby-starter-ghost.git
info Creating new site from git: https://github.com/TryGhost/gatsby-starter-ghost.git
Cloning into 'gatsby-starter-ghost'...
remote: Enumerating objects: 80, done.
remote: Counting objects: 100% (80/80), done.
remote: Compressing objects: 100% (67/67), done.
remote: Total 80 (delta 2), reused 42 (delta 2), pack-reused 0
success Created starter directory layout
info Installing packages...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: gatsby-starter-ghost#2.0.0
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.9.0" from #tryghost/helpers-gatsby#1.0.50
npm ERR! node_modules/#tryghost/helpers-gatsby
npm ERR! #tryghost/helpers-gatsby#"1.0.50" 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/mabvmex/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
ERROR
Command failed with exit code 1: npm install
Error: Command failed with exit code 1: npm install
Any help would be very appreciated.
Thanks in advance.
As it is prompted:
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"17.0.2" from the root project
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.9.0" from #tryghost/helpers-gatsby#1.0.50
npm ERR! node_modules/#tryghost/helpers-gatsby
npm ERR! #tryghost/helpers-gatsby#"1.0.50" 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
You are running React v17.0.2 which it's a major upgrade from the required React version (^16.9.0). You should be able to run your project with your current version of React but you may need to install the peer dependencies by:
npm install gatsby#latest --legacy-peer-deps
Note: remove the package-lock, your node_modules and potentially your .cache folder before running it.

Resources