Actually, I want to know that the problem is with the node version. I have a five-year-old React project that was run in the node-12 version, but now the version is updated for the node.
I tried to create a build from the latest version of Node on the server while deploying to Azure. but it was an error.
When I installed the Node-12 version, it worked, but I am confused: is that a problem with the version of Node or not for the React project?
2
Answers
This is hard to say without seeing your dependencies and code….if there is an error with the build/node modules after updating then it is likely you need to update the existing modules using
npm i
cmd AFTER you update node and make sure you are using latest (i suggest NVM for this)if this does not solve your issue then there could be depreciated node libraries, in this case npm run will usually let you know what module is causing an issue.
if the errors are because of JSX/TSX/React code then you will need to update to the most recent version of react that supports the desired npm version…for example if you’re running latest node with react 15 you will have a lot of issues.
if the issues are in the code itself because you have upgraded react and everything else then you will need to fix/update the specific issues to the latest implementations – for example react router and routing has changed a lot in 5 years so old ways of routing will not work with the new react versions (and for good reason). There have also been some syntax and naming convention changes so you will need to go through each error one by one and find the newer implementation of it and retrofit them.
Without seeing code that is as much info as I can give – good luck!
Since 2019(based on your problem), I think dependencies which are used in your project are not compatible with latest node version because of those are outdates already. So you can update dependencies using npm install command or else you can continue with node version 12 because some dependencies may not update up to now.