I do not have Node.js installed on my machine.
I have been given the source code of an application that is coded in Node.js, Express and AngularJS.
To determine the Angular.js version like any other client side javascript library I can just open the filename and get the version.
In the root folder of my application there is a node_modules folder but there is nowhere I can see what version of Node.js it is for. It does have a debug subdirectory that contains Node.js but opening the file doesn't show me the version number.
When I go to the Node.js website it gives me two version options: 4.5 or 6.5. Which one should I use if I don't even know the version the source code is written in?
1 Answer 1
Since node.js is not bundled with the source code you have to find out yourself. Is there a package.json in the application's root directory? The desired node.js version might be declared at "engines". Beside that the dependencies of your application might have some requirements. So installing node.js 4.5 LTS and running npm install might give some insight.
Are tests present? If there's a reasonable code coverage, running them could give you some safety in guessing if every feature will work with your installed version of node.js.
Usually the dependencies listed in your package.json will dictate the node version you have to use. So if npm install works you're off to a good start. An exception may be if the original author used ES6 features, which means you have to run a quite recent version.
4 Comments
packages.json and there is no "engines" section. Can at least see the Express version"express": "4.13.0",
node -vif you have installedNode.jsnode.js