42

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 Answers 8

77

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"
6
  • 1
    Thanks for your reply, Lloyd. I checked my package.json file and I can't see a devDependencies object anywhere in the file. However, I do have a dependencies object with "natives": "^1.1.6" as one of its properties. Do I need to run a command in order to have devDependencies? Thanks!
    – Student22
    Jan 31, 2019 at 5:28
  • In your package.json, you can just add the devDependencies section. npm.github.io/using-pkgs-docs/package-json/types/… Feb 1, 2019 at 14:44
  • Works fine! Thanks a lot
    – Beto Silva
    Sep 13, 2019 at 20:08
  • 3
    Any comment on this warn from npm: "npm WARN deprecated [email protected]: This module relies on Node.js's internals and will break at some point. Do not use it, and update to [email protected].". Should the solution be to install [email protected]? Sep 24, 2019 at 14:53
  • 1
    Make sure to run "npm install" after making the change
    – hamboy
    Feb 19, 2021 at 21:11
20

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.

2
  • 2
    If you are using yarn, just remove the yarn.lock file instead for package-lock.json
    – Low
    Jun 4, 2020 at 6:27
  • This worked perfectly. Thanks Aug 14 at 18:01
17

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

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

@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

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

2

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

Try this, it's working for me:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.