8000 Project Root: Add minimum npm & node version requirements by pixie-cheeks · Pull Request #478 · TheOdinProject/javascript-exercises · GitHub
[go: up one dir, main page]

Skip to content

Project Root: Add minimum npm & node version requirements #478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

pixie-cheeks
Copy link
Contributor

This change will prevent any old node or npm version from installing any packages. With this, npm will throw an error and exit immediately. This is to prevent the accidental use of unsupported versions which might cause some issues that are hard to pin-point.

Because

A person on Discord was getting some syntax errors when running Jest after installing the packages. It took us a while to figure out that the person was using a really old version of node. The additions in this PR will prevent something like this from happening. If someone tries to run the npm install command with an outdated node/npm version inside the repo, then npm will exit with an error, informing the user their version is too low and what the minimum required version is.

This PR

  • Adds an engines field in the package.json file with the minimum supported node and npm versions
  • Does the same as above in the package-lock.json
  • Adds a .npmrc config file with an option that fails npm install with an error and exits (without this, npm only shows warnings)

Additional Information

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project Contributing Guide
  • The title of this PR follows the location of change: brief description of change format, e.g. 01_helloWorld: Update test cases
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • If this PR addresses an open issue, it is linked in the Issue section
  • If this PR includes any changes that affect the solution of an exercise, I've also updated the solution in the /solutions folder

This change will prevent any old node or npm version from installing any
packages. With this, npm will throw an error and exit immediately.
This is to prevent the accidental use of unsupported versions which
might cause some issues that are hard to pin-point.
Copy link
Member
@wise-king-sullyman wise-king-sullyman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a great change, thanks!

@wise-king-sullyman wise-king-sullyman merged commit 82712db into TheOdinProject:main Jun 11, 2024
Oussama5379 added a commit to Oussama5379/javascript-exercises that referenced this pull request Feb 1, 2025
Project Root: Add minimum npm & node version requirements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0