Skip to end of metadata
Go to start of metadata

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 Symlink

The /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?.

Be careful when using tab expansion to set up the symlink. What you're linking to is actually a directory, and if you include the trailing slash, you will get an error when you push your changes.

ln -s /opt/nodejs/v0.4.1/ nodejs # DO NOT DO THIS

Using config.json to Select the Version Your Application Uses

If 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:

Version Values Description
vX.Y.Z Always use this particular version of Node.js
vX.Y The latest version for that series. For example, v0.4 refers to v0.4.1. If there are bug fixes and the version bumps to v0.4.2, your application will take advantage of those bug fixes.
latest
stable
Your application will always use the latest stable version of Node.js suitable for production work.
edge The cutting edge version of Node.js. Includes all the latest features, but may be buggy.
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
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.