Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

CLI tool for enforcing Node/npm versions with Hall & Oates lyrics

License

NotificationsYou must be signed in to change notification settings

nicheinc/node-can-do

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub licensenpm version

node-can-do is a CLI tool for enforcing a project's Node/npm versions with Hall & Oates lyrics.

Daryl Hall singing "I Can't Go For That"

Installation

To install for usage in a specific project, run the following:

npm install --save-dev node-can-do

Usage

First, specify the version of Node and version of npm that you would like to enforce for your project in the project'spackage.json, specifically in theengines section:

"engines": {"node":"12.13.0","npm":"6.12.1"    },

Make sure to only use a specific value, no version ranges.

In addition/instead ofpackage.json, you can specify the version of Node you would like to enforce in an.nvmrc file.

12.13.0

Next, we recommend usingnode-can-do in conjunction withnpm scripts inpackage.json, e.g.

"scripts": {"myscript":"node-can-do && node ./index.js"},

Or preferably using thepre script hook, e.g.

"scripts": {"premyscript":"node-can-do","myscript":"node ./index.js"},

Finally, run

npm run myscript

If you are running the versions of Node and npm that are specified inpackage.json or.nvmrc, then your script should continue as normal 🎉.

If you are running a different version of Node and/or npm,node-can-do will produce terminal output informing you to change your version of the incorrect tool, and then stop script execution with an exit code 1 🛑.

If there is no specified version of Node and/or npm,node-can-do will produce terminal output informing you to add your required versions in one of the locations specified inUsage, and then stop script execution with an exit code 1 🛑.

Issues

Feel free to file issues athttps://github.com/nicheinc/node-can-do/issues/new

About

CLI tool for enforcing Node/npm versions with Hall & Oates lyrics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp