Get 50% Discount Offer 26 Days

Recommended Services
Supported Scripts
WordPress
Hubspot
Joomla
Drupal
Wix
Shopify
Magento
Typeo3
How to Use Node Version Manager (NVM) in aaPanel

Node Version Manager (NVM) is essential for managing multiple Node.js versions. In aaPanel, you can use NVM using two primary methods: the Node.js Manager plugin (via the App Store) and the Website section to manage projects directly. This guide will walk you through each technique step-by-step to help you manage Node.js environments on your server.

What is Node.js Manager and NVM in aaPanel?

Node.js Manager in aaPanel integrates the powerful features of Node Version Manager (NVM) into an intuitive, user-friendly interface. NVM enables developers to:

  • Install multiple versions of Node.js.
  • Switch between versions seamlessly.
  • Assign specific Node.js versions to projects.

You can leverage NVM’s capabilities alongside aaPanel’s Website section and monitoring tools for an efficient Node.js development workflow.

Benefits of Using Node.js Manager and NVM in aaPanel

  1. Simplified Management: The Node.js Manager plugin simplifies installing, switching, and removing Node.js versions without complex terminal commands.
  2. Project-Specific Versions: Assign different Node.js versions to individual projects, ensuring compatibility across many applications.
  3. Monitoring and Debugging: Use aaPanel’s built-in tools to monitor CPU, memory usage, and logs for Node.js projects.
  4. Improved Flexibility: Manage PHP and Node.js projects simultaneously within the same server environment.

Method 1: Installing and Managing Node.js via the App Store

The first method involves installing and managing NVM and Node.js through the Node.js Manager plugin, available in the aaPanel App Store. This plugin is perfect for managing Node.js versions across multiple projects.

Installing Node.js Manager Plugin

  1. Log in to aaPanel:
    • Open your browser and log in to your aaPanel dashboard.
Steps to access the aaPanel dashboard
  1. Access the App Store:
    • From the left-hand menu, click on App Store.
Clicking on the "App Store" icon in the left-hand menu
  1. Search for Node.js Manager:
    • Use the search bar to locate the Node.js Manager plugin.
Steps to find the Node.js Manager plugin in aaPanel
  1. Install the Plugin:
    • Click Install and wait for the process to complete.
    • Once installed, the plugin will be accessible under the Website section in the Node.js Manager tab.
Steps to install the Node.js Manager plugin in aaPanel

Installing Node.js Versions

  1. Access Node.js Manager:
    • Navigate to Website > Node Project and click Node Version Manager.
Navigating to Node Version Manager in aaPanel
  1. Install a New Version:
    • You will see a list of available Node.js versions in the pop-up window.
    • Choose a version to install by clicking Install next to it.
Selecting a desired Node.js version from the list
  1. Stable vs. Testing Versions:
    • LTS (Long-Term Support) versions are marked as stable and recommended for production use.
    • Testing versions can be used for development and testing purposes.
  2. Monitor Installation Progress:
    • Awaiting installation. The installed version will now appear under the “Environment” section.
Monitoring the installation progress of a Node.js module

Switching Node.js Versions

  1. Set Command-Line Version:
    • Open Node Version Manager and locate the Command Line Version dropdown.
    • Select the Node.js version you want to use.
Setting Command-Line Node.js Version
  1. Save Changes:
    • Click Save to set the selected active version for terminal commands.
Saving Node.js Version Changes in aaPanel

Uninstalling Node.js Versions

  1. Open Node Version Manager:
    • In the Node Version Manager, locate the version you want to remove.
  2. Click Uninstall:
    • Click Uninstall next to the version to remove it from your server.
Locating the desired Node.js version and clicking "Uninstall"
  1. Verify Removal:
    • Ensure the uninstalled version is no longer listed in the Node.js Manager interface.

Method 2: Managing Node.js Projects via the Website Section

The second method involves managing Node.js projects directly in the Website section of aaPanel. It is particularly useful for configuring individual projects.

Adding a Node.js Project

  1. Navigate to the Website Section:
    • Go to Website in the aaPanel dashboard.
  2. Switch to Node Project Tab:
    • Click on the Node Project tab.
  3. Add Node.js Project:
    • Click the Add Node Project button.
    • A configuration window will pop up for project details.
Creating a Node.js Project in aaPanel

Configuring Node.js Settings

  1. Enter Project Information:
    • Project Name: Enter a name for the project.
    • Document Root: Specify the directory where your project files are stored.
    • Node.js Version: Select the appropriate Node.js version for the project from the dropdown.
Configuring Node.js Project Details
  1. Save the Project:
    • Click Confirm to add the project to the list.

Starting and Monitoring Node.js Projects

  1. Start the Project:
    • In the Node Project tab, locate the project and click Start.
Launching a Node.js Project
  1. Monitor Status:
    • Check the project’s Status, PID, CPU, and RAM usage.
    • Use the logs to monitor real-time output or debug errors.
Monitoring Node.js Project Performance
  1. Enable SSL (Optional):

Best Practices for Using NVM in aaPanel

  1. Regular Updates:
    • Keep the Node.js Manager version list updated to access the latest releases.
  2. Use LTS Versions for Production:
    • Always use Long-Term Support (LTS) versions for stable and secure applications.
  3. Isolate Project Versions:
    • Assign specific Node.js versions to projects to avoid compatibility issues.
  4. Monitor Resource Usage:
    • Regularly monitor CPU and RAM usage for Node.js projects using Panel built-in tools.

Troubleshooting Common Issues

Issue 1: Node.js Version Not Available

Solution

Update the version list by clicking Update Version List in the Node Version Manager pop-up.

Issue 2: Node.js Project Not Starting

Solution:

Check for missing dependencies with:

npm install

Make sure the project’s Node.js version is correctly configured.

Issue 3: High CPU or RAM Usage

  • Solution:
    • Optimise application code and dependencies.
    • Upgrade your server resources if necessary.

Conclusion

Using Node Version Manager (NVM) in Panel is a powerful way to manage Node.js environments. With the Node.js Manager plugin and the Website section, you can easily:

  1. Install, switch, and manage Node.js versions.
  2. Configure and run multiple Node.js projects with specific settings.

Following this guide, you can set up and maintain Node.js applications on your aaPanel server. For additional support, refer to aaPanel’s official documentation or community forums.

About the writer

Vinayak Baranwal Article Author

Vinayak Baranwal wrote this article. Use the provided link to connect with Vinayak on LinkedIn for more insightful content or collaboration opportunities.

Leave a Reply

Your email address will not be published. Required fields are marked *

Lifetime Solutions:

VPS SSD

Lifetime Hosting

Lifetime Dedicated Servers