1. node
node
node
Package: node
Created by: aredridel
Last modified: Fri, 03 May 2024 00:24:32 GMT
Version: 22.1.0
License: ISC
Downloads: 787,491
Repository: https://github.com/aredridel/node-bin-gen

Install

npm install node
yarn add node

node

Installs a node binary into your project, which because npm runs scripts with the local ./node_modules/.bin in the PATH ahead of the system copy means you can have a local version of node that is different than your system's, and manage node as a normal dependency.

Warning: don't install this globally with npm 2. npm@2 immediately removes node, then can't run the scripts that make this work.

Use

npm i node@lts

Use with npx

npx node@4 myscript.js

This will run myscript.js with the latest version of node from the v4 major.

Using the shell auto-fallback of npx, you can even do it like so:

node@4 myscript.js

Thanks

Major thanks to Kat Marchán for late-night problem solving, and to CJ Silverio and Maciej Małecki for egging me on way back when I had the idea to package node up this way. It does turn out if you ask "why not?!" once in a while something fun happens.

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin