Skip to content
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

Merged
merged 16 commits into from
Jun 1, 2023

Conversation

andrew-maslov
Copy link
Contributor

@andrew-maslov andrew-maslov added the in tech review PR is in review by a developer label May 16, 2023
@andrew-maslov andrew-maslov added the 202400 PR contains document for the upcoming release 202400 label May 18, 2023
FRITS-Kh
FRITS-Kh previously approved these changes May 30, 2023

## 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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`:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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`:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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`:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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`;
Copy link
Contributor

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:

Suggested change
- 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.
Copy link
Contributor

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.

Suggested change
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.
Copy link
Contributor

@VadymSachenko VadymSachenko May 30, 2023

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?

Suggested change
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:
Copy link
Contributor

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:
Copy link
Contributor

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?

VadymSachenko
VadymSachenko previously approved these changes May 30, 2023
@VadymSachenko VadymSachenko added ready for merge The PR can be merged and removed in tech review PR is in review by a developer labels May 31, 2023
@VadymSachenko VadymSachenko changed the title CC-25660: Migration Guide Update Node.js to v18 Migration guide - Upgrade Node.js to v18 and npm to v9 May 31, 2023
@VadymSachenko VadymSachenko added the new PR contains a new document label May 31, 2023
@VadymSachenko VadymSachenko merged commit fe8c72f into master Jun 1, 2023
@VadymSachenko VadymSachenko deleted the feature/cc-25660-update-nodejs-to-v18 branch June 1, 2023 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
202400 PR contains document for the upcoming release 202400 new PR contains a new document ready for merge The PR can be merged
Development

Successfully merging this pull request may close these issues.

3 participants