38
votes

I'm getting this error when I try to run the command gulp watch-bs for my UnderStrap child theme for WordPress. I've been using this command for a year with no problems, but I received this error today when I updated my node and npm to their latest versions.

ReferenceError: internalBinding is not defined
    at internal/util/inspect.js:31:15
    at req_ (C:\xampp\htdocs\node_modules\natives\index.js:137:5)
    at require (C:\xampp\htdocs\node_modules\natives\index.js:110:12)
    at util.js:25:21
    at req_ (C:\xampp\htdocs\node_modules\natives\index.js:137:5)
    at require (C:\xampp\htdocs\node_modules\natives\index.js:110:12)
    at fs.js:42:21
    at req_ (C:\xampp\htdocs\node_modules\natives\index.js:137:5)
    at Object.req [as require] (C:\xampp\htdocs\node_modules\natives\index.js:54:10)
    at Object.<anonymous> (C:\xampp\htdocs\node_modules\vinyl-fs\node_modules\graceful-fs\fs.js:1:99)

I've read here that, in order to resolve the issue, I need to run this command:

npm install [email protected]

but this did not help resolve the issue.

Am I missing something else?

8

8 Answers

70
votes

I ran into the same issue as you. To fix it, I added the following to my package.json in the devDependencies section

"natives": "^1.1.6"
18
votes

I had the same error after upgrading node to v10.16.0

I ran the following which solved my issue:

rm -rf node_modules
rm package-lock.json
npm cache clean --force
npm install 

After closer inspection, it would seem that the generated tree in package-lock was outdated.

16
votes

I also faced the same problem and then I fixed by the following command:

npm install [email protected]

May be helpful if someone having same issue. updating node to latest version requires above package.

6
votes

I recently ran into the same problem after installing node. Similar to @Dv-Learner answer, What fixed it for me was:

npm install [email protected]
npm rebuild node-sass

the bit about rebuild node-sass was required for my machine (Windows)

2
votes

@Student 22, in addition to Lloyd's solution, I simply updated my version to the most recent version for gulp using the command below ( Local Version 3.9.1 to Local Version 4.0.0) and I didn't run any additional commands.

npm install gulp-update

Reference: https://github.com/nodejs/node/issues/24985

Good luck!

2
votes

Had the same error. Solved it by installing graceful-fs.

It seems that natives package is now deprecatd and you should install graceful-fs instead.

I had node v10.16.1 and glup local version 3.9.1. I ran 'npm install graceful-fs' and glup no longer gave the error in this question. (Can't comment yet, so an answer).

0
votes

In my case, I downgraded my node version from 10.16.0 to 8.11.4 which was required by my current project by this command

sudo n 8.11.4

0
votes

Try this, it's working for me:

npm install -g graceful-fs graceful-fs@latest