# nvmrc-check

> Check if nvmrc version matches node version.

Latest version **1.0.2** (published 2017-06-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install nvmrc-check
pnpm add nvmrc-check
yarn add nvmrc-check
bun add nvmrc-check
```

Provides the command `nvmrc-check`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-06-15 |
| First published | 2017-06-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Skyler Fenn |
| Maintainers | skylerfenn |
| Keywords | version, node, nvmrc |

## Links

- npm: https://www.npmjs.com/package/nvmrc-check
- Repository: https://github.com/skylerfenn/nvmrc-check
- Homepage: https://github.com/skylerfenn/nvmrc-check#readme
- Issues: https://github.com/skylerfenn/nvmrc-check/issues
- npm.io page: https://npm.io/package/nvmrc-check

## Dependencies (1)

- [semver](https://npm.io/package/semver.md) ^5.3.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2017-06-15
- 1.0.1 — 2017-06-09
- 1.0.0 — 2017-06-09

## README

# nvmrc-check

1) Add [.nvmrc](https://github.com/creationix/nvm#nvmrc) file to project root with version number:
```
8.0
```

2) Add to package.json as script
```
scripts {
  "postinstall": "nvmrc-check --node $(cat .nvmrc)"
}
```

3) If current node version doesn't match, script fails.

Note: Use [nvm trick](https://github.com/creationix/nvm#zsh) with [zsh](https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH) to call `nvm use` automatically whenever you enter a directory that contains an `.nvmrc` file. Or add to your `.bash_profile` (adapted from [unix stackexchange](https://unix.stackexchange.com/questions/21363/execute-bash-scripts-on-entering-a-directory/21364#21364) thread):

```
cd () { builtin cd "$@" && chpwd; }
pushd () { builtin pushd "$@" && chpwd; }
popd () { builtin popd "$@" && chpwd; }
chpwd () {

FILE=$PWD/.nvmrc

if [ -f $FILE ];
then
   nvm install $(cat .nvmrc)
fi
}
```

---
_Source: https://npm.io/package/nvmrc-check · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
