.../articles/
Using nodenv to Pin a Node Version per Project

Using nodenv to Pin a Node Version per Project

2019.10.23

Environment

  • OS: macOS Catalina (10.15)
  • Node: 12.10.0

Installing the Target Node Version

# Check the node versions installed via nodenv
# The system's built-in node and 10.16.3 are currently installed
$ nodenv versions
  system
* 10.16.3 (set by ~/.nodenv/version)

It looks like the version we want to install isn't installed in nodenv yet, so let's install it with nodenv install 12.10.0. You can also check the list of installable versions with nodenv install --list.

# Check the list of installable versions
$ nodenv install --list

# Install 12.10.0 via nodenv
$ nodenv install 12.10.0
Downloading node-v12.10.0-darwin-x64.tar.gz...
-> https://nodejs.org/dist/v12.10.0/node-v12.10.0-darwin-x64.tar.gz
Installing node-v12.10.0-darwin-x64...
Installed node-v12.10.0-darwin-x64 to ~/.nodenv/versions/12.10.0

# Check with the nodenv versions command that it was installed
# If 12.10.0 shows up, the install succeeded
$ nodenv versions
  system
* 10.16.3 
  12.10.0

Setting Up a Local Environment

Now let's set up per-directory environments. Just move to the target directory and run nodenv local 12.10.0.

# Move to the target directory and specify the version
$ mkdir LocalNodeTest
$ cd LocalNodeTest
$ nodenv local 12.10.0

## Check the version
$ node -v
v12.10.0
$ nodenv versions
  system
  10.16.3
* 12.10.0 (set by {target directory}/LocalNodeTest/.node-version)

Now, only within LocalNodeTest is the Node version set to 12.10.0. That was really easy to do. The version information is written to LocalNodeTest/.node-version, and it's a good idea to keep this file under git management so the version used by the project is documented clearly.

written by

.../article/

Articles

All articles

From Firebase to Vercel, Contentful to microCMS — a migration log written with Claude Code

From Firebase to Vercel, Contentful to microCMS — a migration log written with Claude Code

We moved our corporate site's hosting and CMS, and made it bilingual along the way. The constraints we only found by running against real data were more useful than the migration itself, so this post focuses on where we got stuck.

Can't Read POST Data with Firebase Functions × Remix?

Can't Read POST Data with Firebase Functions × Remix?

How to read POST data from a Remix action when running on Firebase Functions.

Generative AI for Executives and Leaders: An Approach to Self-Driven DX

Generative AI for Executives and Leaders: An Approach to Self-Driven DX

Building a structure where executives and leaders themselves can identify issues and evaluate solutions using generative AI. We introduce how combining this with our hands-on support dramatically improves both the quality and speed of digital transformation.

Deploying a Monorepo Next.js App (App Router) to AWS Amplify

Deploying a Monorepo Next.js App (App Router) to AWS Amplify

Notes on the obstacles we hit while deploying a Next.js app managed in a monorepo to AWS Amplify.

Keeping Production Running Smoothly with Remote Work and Online Meetings [Documentation]

Keeping Production Running Smoothly with Remote Work and Online Meetings [Documentation]

Many production companies have adopted remote work as a result of the pandemic, and we are one of them.

Designing an E-Commerce Site That Sells: How to Find Great Reference Examples

Designing an E-Commerce Site That Sells: How to Find Great Reference Examples

There is no single formula for e-commerce design that sells. Driving revenue requires a solid concept, and getting to that concept requires thorough research.

Productivity Tools We Recommend as a Production Company, Including Services That Work Well Solo

Productivity Tools We Recommend as a Production Company, Including Services That Work Well Solo

With remote work becoming the norm during the COVID-19 pandemic, our team now works from home most days of the week.

We Released Thought Recorder, a Figma Plugin for Keeping a Commit History of Your Designs

We Released Thought Recorder, a Figma Plugin for Keeping a Commit History of Your Designs

We hope this helps web designers who work in Figma. Read on for how to use it.

How to Build an E-Commerce Site, and Which Platforms We Recommend

How to Build an E-Commerce Site, and Which Platforms We Recommend

Shopping online for fashion, appliances, and even groceries is now routine. With the pandemic accelerating the shift, we receive a steady stream of questions about which platform to use and how much it costs.

Generating FastAPI Schema Classes from OpenAPI

Generating FastAPI Schema Classes from OpenAPI

We chose FastAPI, a relatively modern framework, for a Python API project. FastAPI can generate an OpenAPI definition from your backend code, but here we do the opposite: generating FastAPI schema classes from an OpenAPI definition prepared in advance.

View all articles

Contact us