Skip to content

Commit 1215a92

Browse files
committed
Updated node version to 12.
1 parent 28c7ca3 commit 1215a92

File tree

5 files changed

+61
-20
lines changed

5 files changed

+61
-20
lines changed

.github/workflows/deploy-prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
strategy:
1616
matrix:
17-
node-version: [10.x]
17+
node-version: [12.x]
1818

1919
steps:
2020
- uses: actions/checkout@v2

.github/workflows/deploy-staging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [10.x]
15+
node-version: [12.x]
1616

1717
steps:
1818
- uses: actions/checkout@v2

docs/primordials-is-not-defined.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
We encountered the same issue when updating a legacy project depending on `[email protected]` to Node.js 12+.
2+
3+
These fixes enable you to use Node.js 12+ with `[email protected]` by overriding `graceful-fs` to version `^4.2.4`.
4+
5+
If you are using yarn v1
6+
------------------------------------------------------------
7+
Yarn v1 [supports resolving a package to a defined version][2].
8+
You need to add a `resolutions` section to your `package.json`:
9+
```json
10+
{
11+
// Your current package.json contents
12+
"resolutions": {
13+
"graceful-fs": "^4.2.4"
14+
}
15+
}
16+
```
17+
Thanks [@jazd][3] for this way to solve the issue.
18+
19+
If you are using npm
20+
--------------------------------------------------------
21+
Using [`npm-force-resolutions`][4] as a preinstall script, you can obtain a similar result as with yarn v1. You need to modify your package.json this way:
22+
```json
23+
{
24+
// Your current package.json
25+
"scripts": {
26+
// Your current package.json scripts
27+
"preinstall": "npx npm-force-resolutions"
28+
},
29+
"resolutions": {
30+
"graceful-fs": "^4.2.4"
31+
}
32+
}
33+
```
34+
`npm-force-resolutions` will alter the `package-lock.json` file to set `graceful-fs`to the wanted version before the `install` is done.
35+
36+
If you are using a custom `.npmrc` file in your project and it contains either a proxy or custom registry, you might need to change `npx npm-force-resolutions` to `npx --userconfig .npmrc npm-force-resolutions` because as of now, `npx` doesn't use the current folder `.npmrc` file by default.
37+
38+
Origin of the problem
39+
---------------------
40+
This issue stems from the fact that `[email protected]` [depends][5] on `graceful-fs@^3.0.0` which monkeypatches Node.js `fs` module.
41+
42+
This used to work with Node.js until version 11.15 (which is a [version][6] from a development branch and shouldn't be used in production).
43+
44+
[`graceful-fs@^4.0.0`][7] does not monkeypatch Node.js `fs` module anymore, which makes it compatible with Node.js > 11.15 (tested and working with versions 12 and 14).
45+
46+
Note that this is not a perennial solution but it helps when you don't have the time to update to `gulp@^4.0.0`.
47+
48+
49+
[1]: https://docs.npmjs.com/files/shrinkwrap.json
50+
[2]: https://classic.yarnpkg.com/en/docs/selective-version-resolutions/
51+
[3]: https://stackoverflow.com/users/1650473/jazd
52+
[4]: https://github.com/rogeriochaves/npm-force-resolutions
53+
[5]: https://github.com/gulpjs/gulp/blob/v3.9.1/package.json#L47
54+
[6]: https://nodejs.org/en/about/releases/
55+
[7]: https://github.com/isaacs/node-graceful-fs#v4

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@
9999
"vue-sequence": "^1.0.128",
100100
"vuex": "^3.6.2"
101101
},
102+
"resolutions": {
103+
"graceful-fs": "^4.2.4"
104+
},
102105
"jest": {
103106
"verbose": true
104107
},

yarn.lock

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6943,23 +6943,11 @@ got@^8.3.1:
69436943
url-parse-lax "^3.0.0"
69446944
url-to-options "^1.0.1"
69456945

6946-
graceful-fs@^3.0.0:
6947-
version "3.0.12"
6948-
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-3.0.12.tgz#0034947ce9ed695ec8ab0b854bc919e82b1ffaef"
6949-
integrity sha512-J55gaCS4iTTJfTXIxSVw3EMQckcqkpdRv3IR7gu6sq0+tbC363Zx6KH/SEwXASK9JRbhyZmVjJEVJIOxYsB3Qg==
6950-
dependencies:
6951-
natives "^1.1.3"
6952-
6953-
graceful-fs@^4.0.0, graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4:
6946+
graceful-fs@^3.0.0, graceful-fs@^4.0.0, graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4, graceful-fs@~1.2.0:
69546947
version "4.2.4"
69556948
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb"
69566949
integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==
69576950

6958-
graceful-fs@~1.2.0:
6959-
version "1.2.3"
6960-
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-1.2.3.tgz#15a4806a57547cb2d2dbf27f42e89a8c3451b364"
6961-
integrity sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=
6962-
69636951
growly@^1.3.0:
69646952
version "1.3.0"
69656953
resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081"
@@ -10179,11 +10167,6 @@ nash@^3.0.0:
1017910167
lodash "^4.17.5"
1018010168
minimist "^1.1.0"
1018110169

10182-
natives@^1.1.3:
10183-
version "1.1.6"
10184-
resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.6.tgz#a603b4a498ab77173612b9ea1acdec4d980f00bb"
10185-
integrity sha512-6+TDFewD4yxY14ptjKaS63GVdtKiES1pTPyxn9Jb0rBqPMZ7VcCiooEhPNsr+mqHtMGxa/5c/HhcC4uPEUw/nA==
10186-
1018710170
natural-compare@^1.4.0:
1018810171
version "1.4.0"
1018910172
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"

0 commit comments

Comments
 (0)