Skip to content

Commit

Permalink
build: Fix gulp format for Node >= 10.14 (angular#28213)
Browse files Browse the repository at this point in the history
With Node.js v10.14 and greater, running `yarn gulp format` produces
the following error:

```
$ nvm current
v10.15.0
$ yarn gulp format:changed
yarn run v1.12.3
$ /usr/local/google/home/kyliau/Documents/GitHub/angular/node_modules/.bin/gulp format:changed
internal/util/inspect.js:31
const types = internalBinding('types');
              ^

ReferenceError: internalBinding is not defined
    at internal/util/inspect.js:31:15
    at req_ (/usr/local/google/home/kyliau/Documents/GitHub/angular/node_modules/natives/index.js:137:5)
    at require (/usr/local/google/home/kyliau/Documents/GitHub/angular/node_modules/natives/index.js:110:12)
    at util.js:25:21
    at req_ (/usr/local/google/home/kyliau/Documents/GitHub/angular/node_modules/natives/index.js:137:5)
    at require (/usr/local/google/home/kyliau/Documents/GitHub/angular/node_modules/natives/index.js:110:12)
    at fs.js:42:21
    at req_ (/usr/local/google/home/kyliau/Documents/GitHub/angular/node_modules/natives/index.js:137:5)
    at Object.req [as require] (/usr/local/google/home/kyliau/Documents/GitHub/angular/node_modules/natives/index.js:54:10)
    at Object.<anonymous> (/usr/local/google/home/kyliau/Documents/GitHub/angular/node_modules/vinyl-fs/node_modules/graceful-fs/fs.js:1:99)
```

A search on GitHub reveals this issue is due to [email protected]:
gulpjs/gulp#2246

```
$ yarn why natives
yarn why v1.12.3
[1/4] Why do we have the module "natives"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "[email protected]"
info Reasons this module exists
   - "gulp#vinyl-fs#graceful-fs" depends on it
   - Hoisted from "gulp#vinyl-fs#graceful-fs#natives"
   - Hoisted from "browserstacktunnel-wrapper#unzip#fstream#graceful-fs#natives"
```

The solution is to add a manual resolution for [email protected]

PR Close angular#28213
  • Loading branch information
Keen Yee Liau authored and alxhub committed Jan 22, 2019
1 parent 058aafc commit 0b6eaca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,9 @@
"vlq": "0.2.2",
"vrsource-tslint-rules": "5.1.1",
"webpack": "1.12.9"
},
"// 4": "natives is needed for gulp to work with node >= 10.13, see #28213",
"resolutions": {
"natives": "1.1.6"
}
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6122,10 +6122,10 @@ nanomatch@^1.2.9:
snapdragon "^0.8.1"
to-regex "^3.0.1"

natives@^1.1.0:
version "1.1.4"
resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.4.tgz#2f0f224fc9a7dd53407c7667c84cf8dbe773de58"
integrity sha512-Q29yeg9aFKwhLVdkTAejM/HvYG0Y1Am1+HUkFQGn5k2j8GS+v60TVmZh6nujpEAj/qql+wGUrlryO8bF+b1jEg==
natives@1.1.6, natives@^1.1.0:
version "1.1.6"
resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.6.tgz#a603b4a498ab77173612b9ea1acdec4d980f00bb"
integrity sha512-6+TDFewD4yxY14ptjKaS63GVdtKiES1pTPyxn9Jb0rBqPMZ7VcCiooEhPNsr+mqHtMGxa/5c/HhcC4uPEUw/nA==

needle@^2.2.1:
version "2.2.4"
Expand Down

0 comments on commit 0b6eaca

Please sign in to comment.