So, one of the problems commonly with node projects is that you start on a specific version and everything is fine. As time goes by, dependancies get updated, you regenerate your package-lock.json or you add new things for a specific node version and stuff starts to break because the project was started on a specific version. It's generally a good idea to include an engines clause in the package.json file so that booting up the code from a fresh clone doesn't have problems. This is an example for LTS node as of this issue:
"engines": {
"node": ">=18.19.x"
},
Also, it's generally a good idea to use nvm if you aren't already. It's very common to need a specific version of node for different projects - and this helps keep global installs in check as well. A lot of people like to write an .nvmrc file to their project with the current node version so that their current shell automatically switches to that version when they enter the directory. This is completely optional but a nice thing to add.
So, one of the problems commonly with node projects is that you start on a specific version and everything is fine. As time goes by, dependancies get updated, you regenerate your
package-lock.json
or you add new things for a specific node version and stuff starts to break because the project was started on a specific version. It's generally a good idea to include anengines
clause in thepackage.json
file so that booting up the code from a fresh clone doesn't have problems. This is an example for LTS node as of this issue:Also, it's generally a good idea to use nvm if you aren't already. It's very common to need a specific version of node for different projects - and this helps keep global installs in check as well. A lot of people like to write an
.nvmrc
file to their project with the current node version so that their current shell automatically switches to that version when they enter the directory. This is completely optional but a nice thing to add.