creativecommons / creativecommons/ccos-website-source
[Content] The need to require a Node.js version is not specified in JavaScript Guidelines
- Dominant language
- CSS
- Stars
- 99
- Forks
- 190
- PR merge metrics
- No merged PRs in 30d
Description
## Problem
Currently there is not a consistent method across repositories for requiring a minimum Node.js version. This can and will create issues for contributing to repositories.
## Description
This can be solved by adding guidance in the Javascript Guidelines to add:
`"engines" : { "npm" : ">=x.y.z","node" : ">=x.yz"}` to the package.json file as a baseline standard
## Alternatives
Additionally, you can edit the `.npmrc` file to contain:
```
# .npmrc
engine-strict=true
```
but this provides inconsistent behavior, as local devs may have their own pre-existing `.npmrc` file.
A `.nvmrc` route is also possible and *might* have better outcomes
* https://github.com/nvm-sh/nvm#nvmrc
## Additional context
- [(comment) - npm - How can I specify the required Node.js version in package.json? - Stack Overflow](https://stackoverflow.com/questions/29349684/how-can-i-specify-the-required-node-js-version-in-package-json/29349773#29349773)
- [JavaScript Guidelines — Creative Commons Open Source](https://opensource.creativecommons.org/contributing-code/javascript-guidelines/)
## Implementation
- [ ] I would be interested in implementing this feature.
Contributor guide
Assessment
This issue has not been assessed yet.