-
Notifications
You must be signed in to change notification settings - Fork 97
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
Migration guide - Upgrade Node.js to v18 and npm to v9 #1854
Conversation
docs/scos/dev/front-end-development/202304.0/migration-guide-upgrade-nodejs-to-v18.md
Outdated
Show resolved
Hide resolved
docs/scos/dev/front-end-development/202304.0/migration-guide-upgrade-nodejs-to-v18.md
Outdated
Show resolved
Hide resolved
docs/scos/dev/front-end-development/202304.0/migration-guide-upgrade-nodejs-to-v18.md
Outdated
Show resolved
Hide resolved
docs/scos/dev/front-end-development/202304.0/migration-guide-upgrade-nodejs-to-v18.md
Outdated
Show resolved
Hide resolved
|
||
## Overview | ||
|
||
According to [Node.js schedule](https://github.com/nodejs/release#release-schedule) the 16 version will be maintained till 11.09.2023. So Spryker recommends migrating to 18 LTS version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to [Node.js schedule](https://github.com/nodejs/release#release-schedule) the 16 version will be maintained till 11.09.2023. So Spryker recommends migrating to 18 LTS version. | |
According to [Node.js schedule](https://github.com/nodejs/release#release-schedule), the maintenance of version 16 stops on September 11, 2023. Therefore, we recommend migrating to the 18 LTS version. |
|
||
## 1) Update configuration files | ||
|
||
1. Set up new versions of `node/npm` in the main `*.yml` files, like `deploy.yml`, `deploy.dev.yml`, and `deploy.ci.yml`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Set up new versions of `node/npm` in the main `*.yml` files, like `deploy.yml`, `deploy.dev.yml`, and `deploy.ci.yml`: | |
1. In the main `*.yml` files, set up new versions of `node/npm`, like `deploy.yml`, `deploy.dev.yml`, and `deploy.ci.yml`: |
|
||
{% endinfo_block %} | ||
|
||
2. In the root directory, create/update `.nvmrc` file with the following content: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. In the root directory, create/update `.nvmrc` file with the following content: | |
2. In the root directory, create or update the `.nvmrc` file with the following content: |
18.16.0 | ||
``` | ||
|
||
3. Update or add dependencies and engines in the `package.json`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3. Update or add dependencies and engines in the `package.json`: | |
3. In the `package.json`, update or add dependencies and engines: |
} | ||
``` | ||
|
||
4. Remove dependency in the `package.json`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4. Remove dependency in the `package.json`: | |
4. In the `package.json`, remove the dependency : |
``` | ||
|
||
5. Update webpack config in `frontend/configs/development.js`: | ||
- Replace `options` of `postcss-loader`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these are steps, then use the numbered list instead of bulleted points. Also, correct grammar:
- Replace `options` of `postcss-loader`; | |
1. In `postcss-loader`, replace `options`. |
|
||
{% info_block infoBox "Note" %} | ||
|
||
Ensure that the `package-lock.json` file has `"lockfileVersion": 2` or higher, otherwise need to remove `node_modules` and `package-lock.json`. After that regenerate again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure I rephrased the sentence correctly, and that it carries the same meaning.
Ensure that the `package-lock.json` file has `"lockfileVersion": 2` or higher, otherwise need to remove `node_modules` and `package-lock.json`. After that regenerate again. | |
Ensure that the `package-lock.json` file has `"lockfileVersion": 2` or later; otherwise, remove `node_modules` and `package-lock.json` and regenerate the file again. |
{% endinfo_block %} | ||
|
||
## 3) Update GitHub Actions | ||
In case using GitHub Actions on the project need to update `.github/workflows/ci.yml` file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be step 1?
In case using GitHub Actions on the project need to update `.github/workflows/ci.yml` file. | |
If you're using GitHub Actions on the project, update the `.github/workflows/ci.yml` file. |
|
||
## 3) Update GitHub Actions | ||
In case using GitHub Actions on the project need to update `.github/workflows/ci.yml` file. | ||
Update Node.js version: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be step 2?
node-version: '18' | ||
``` | ||
|
||
Remove npm cache: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be step 3?
docs/scos/dev/front-end-development/202304.0/migration-guide-upgrade-nodejs-to-v18.md
Outdated
Show resolved
Hide resolved
...os/dev/front-end-development/202304.0/migration-guide-upgrade-nodejs-to-v18-and-npm-to-v9.md
Outdated
Show resolved
Hide resolved
…pgrade-nodejs-to-v18-and-npm-to-v9.md
Ticket: https://spryker.atlassian.net/browse/CC-25660