We have a react app that uses 14.x.x version. Now we would like to upgrade the node version to 19.x.x. Can you please guide the steps to do that?
In package.json it is mentioned as
engines: {
"node": ">=14.15.1"
}
We have a react app that uses 14.x.x version. Now we would like to upgrade the node version to 19.x.x. Can you please guide the steps to do that?
In package.json it is mentioned as
engines: {
"node": ">=14.15.1"
}
its npm update is the command to update all dependencies in the project but first check the outdated packages and comparisons using npm outdated command. it will nicely list the current, outdated and required package list.
check the list and update as per your project code. Be careful about breaking changes.
More info: https://docs.npmjs.com/updating-packages-downloaded-from-the-registry
Using NPM:To update Node using NPM do the following: 1.Open the Terminal and check your current Node version: node -v Install n package using the following command: npm install -g n
This command will install a tool called "n" which you can use to update Node easily.
2.To update Node, run the following command in your terminal: n latest This command will install the latest version of Node on your system.Now you can
3.verify that your update is complete by rechecking your Node version: node -v.
You can also manually download and install the latest Node version from the official website. https://nodejs.org/en/download/current
For a greater version jump I actually recommend creating a new project and then pasting your source and configuration there.
For usage with Yoeman and Node 22:
Install the new node version, e.g. with Node Version Manager (nvm):
nvm install 22.20.1 # Will be supported until 2027
nvm use 22
Install the required global packages for the new node version:
Execute yoeman in a new folder with your solution name to create your new solution
yo
SharePoint
Webpart
React (or the one you need)
Original project name
Install packages
Adjust and overwrite
config.json (overwrite)
package-solution.json (overwrite)
serve.json (overwrite)
src folder (overwrite)
package.json: "version"
.yo-rc.json: "libraryId"
.eslintrc.js, tsconfig.json (adjust as needed)
Test
gulp build
gulp serve
Test in Browser (Workbench)