|
Your Node.js™ Development SmartMachine uses two ways to determine the version of Node.js you use. One mechanism controls the version of Node.js used in your login environment as when you SSH into your Node.js Development SmartMachine and use npm to install packages. The other controls the version that's used when you push a new version of your application and your application runs. In most cases you will want both mechanisms to point to the same version of Node.js. But in some situations, you may want to ensure that your application runs with a specific version of Node.js. By default, your Node.js Development SmartMachine uses the latest stable version of Node.js. In this page: Changing the nodejs SymlinkThe /home/node/local/nodejs symlink points to the directory that contains the version of Node.js used when you log in to your Node.js Development SmartMachine. This is the version the npm looks at when you install packages To make sure that you're always using the latest version of node, see that /home/node/local/nodejs points to the latest version: You can use any of the version designators described in Which Versions Are Available?.
Using config.json to Select the Version Your Application UsesIf your application must use a specific version of Node.js, add a file named config.json that contains the following: config.json When you push the change to your Node.js Development SmartMachine, your application runs with the version you selected: If your repository does not contain a config.json, it uses the /home/node/local/nodejs symlink. Which Versions Are Available?To find out which Node.js versions are available, log in to your Node.js Development SmartMachine and look at the file /opt/nodejs/NODE-BUILDS. /opt/nodejs/NODE-BUILDS You can use these special version values to make sure that you're always using the most recent version of Node.js for your requirements:
|
At a Glance
You can easily specify which version of Node.js your SmartMachine uses. If you do not change the version yourself, your Node.js Development SmartMachine uses the latest version. The /home/node/local/nodejs symlink points to the directory that contains the version of Node.js used when you log into your Node.js Development SmartMachine. The file config.json can designate a different version of Node.js to use when your application runs. |
Labels:
None