GithubHelp home page GithubHelp logo

isabella232 / ensure-node-env Goto Github PK

View Code? Open in Web Editor NEW

This project forked from skyscanner/ensure-node-env

0.0 0.0 0.0 358 KB

A script that helps ensure you have the correct node & npm versions installed in your environment.

License: Apache License 2.0

Shell 8.54% JavaScript 91.46%

ensure-node-env's Introduction

ensure-node-env

Build Status

A script that helps ensure you have the correct node & npm versions installed globally in your environment.

Usage

Add the following to your package.json:

  ...
  "engines": {
    "node": "^10.14.1",
    "npm": "^6.4.1"
  },
  "scripts": {
    "preinstall": "npx ensure-node-env",
    ...

Where the node and npm engine properties specify a valid semver range for Node and npm version respectively.

By default, if you have a node or npm binary installed locally to the project (thus ending up in ./node_modules/.bin), it will take precedence. If you want to check against a globally installed version instead, you can pass the --ignore-local-bin parameter (-i for short).

It's worth noting that, while you may not be directly depending on node or npm packages, you may still have them as transitive dependencies - in any case, ensure-node-env will show which one is being considered and where it comes from.

By default, the script's output is minimal. If you want it to display more information, such as the exact versions being compared, you can pass the --verbose parameter (-v for short).

Usage in libraries

This script is designed to be used as a development-only preinstall check in the project root. For libraries that are published and consumed in other projects it is considered good enough to include it as a pretest check:

npm install ensure-node-env --save-dev
  ...
  "engines": {
    "node": "^10.14.1",
    "npm": "^6.4.1"
  },
  "scripts": {
    "pretest": "ensure-node-env",
    ...

Guide

Skyscanner Node development requires Node LTS and npm ^16.14.2. Nvm users can run nvm use to switch to lts/gallium. Nave users can use nave auto. You can also download Node LTS using the website.

ensure-node-env's People

Contributors

greenkeeper[bot] avatar k0nserv avatar matteo-hertel avatar matthewdavidson avatar olliecurtis avatar shaundon avatar snyk-bot avatar tatablack avatar tiagoengel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.