Code-Hero: Node.js
Using Node.js with Code-Hero
👋 Welcome to the Stackhero documentation!
Stackhero offers Code-Hero, a complete development platform to code in seconds:
- Code from anywhere: Use any device, be it a desktop, phone, or tablet, without requiring any software installations.
- Integrated VSCode experience: Work with a customized version of VSCode directly through your browser, featuring a fully functional terminal.
- Comprehensive toolset: Benefit from a pre-configured environment with tools and languages like
Docker,Git,Zsh,Node.js,Go,Python,Ruby, and more.- Seamless connectivity: Access your development applications via HTTPS on a public domain, mimicking production conditions. This setup supports webhooks and external integrations effortlessly.
Experience the efficiency and convenience of Stackhero's Code-Hero development cloud solution. It takes just 5 minutes to get started! Simplify your development processes and save valuable time today.
Code-Hero includes asdf, a flexible version management tool, enabling you to select the Node.js version that aligns with your project requirements.
By default, Code-Hero provides the Node.js Long Term Support (LTS) version, along with the latest releases of npm and yarn. To confirm the installed Node.js version, you can use the following command:
node -v
Updating to the latest LTS version of Node.js
To make sure you are working with the latest Node.js LTS version, you might find these steps helpful:
asdf plugin update nodejs
asdf nodejs update-nodebuild
asdf install nodejs $(asdf nodejs resolve lts --latest-available)
asdf global nodejs $(asdf nodejs resolve lts --latest-available)
Switching to a different Node.js version
If your project requires a specific Node.js version, you can follow these steps to switch versions:
# Update all asdf plugins to their latest versions
asdf plugin update --all
# List all available Node.js versions
asdf list all nodejs
# Install a desired Node.js version by substituting <VERSION> with the version number
asdf install nodejs <VERSION>
# Verify the current Node.js version
node -v
With these commands, you have the tools to effectively manage and tailor your Node.js environment to meet the needs of your projects.