Node.js
Node.js runtime and npm package manager run JavaScript applications and manage dependencies
The HPC system provides Node.js v10.24.0 and npm v6.14.11 for running JavaScript and managing packages.
This system version is intentionally older for compatibility reasons, but users may install newer versions of Node.js in their home directory using NVM (Node Version Manager).
Example Usage#
Create a file named hello.js with the following content:
Run it with:
Additionally you can install packages locally using npm:
After installation, you can use the packages in your Node.js scripts.
For more information visit the Node.js or npm documentation websites.
Installing a Newer Node.js Version Using NVM#
Users who need modern Node.js features can install a newer version without administrator privileges using nvm.
This method installs Node.js entirely in your home directory.
1. Install NVM#
Run the official installation script:
Then reload your environment so that nvm becomes available:
You can verify installation with:
If the command prints nvm, the installation succeeded.
2. Install a New Node.js Version#
Use nvm to install the current LTS release:
Or install a specific version:
Confirm the version:
3. Set a Default Node.js Version#
To automatically use a specific version each time you log in:
4. Installing Packages With NVM-Managed Node#
Once you've activated the desired Node.js version, you can use npm normally:
All packages are stored in your home directory, isolated from the system installation.