gulp打包报错:ReferenceError: internalBinding is not defined的解决办法

来源:网络 文章列表 2019-07-10 8
gulp打包报错:ReferenceError: internalBinding is not defined的解决办法.这个问题是我将node版本升级至v10.15.0,npm升级至6.4.1后出现的,在此之前,我的node版本是8+,没有出现这个问题。

本地执行npm run dev 运行gulp watch时报ReferenceError: internalBinding is not defined错误

具体报错信息如下:

internal/util/inspect.js:31
const types = internalBinding('types');
              ^

ReferenceError: internalBinding is not defined
    at internal/util/inspect.js:31:15
    at req_ (E:\mywork\auto\node_modules\natives\index.js:137:5)
    at require (E:\mywork\auto\node_modules\natives\index.js:110:12)
    at util.js:25:21
    at req_ (E:\mywork\auto\node_modules\natives\index.js:137:5)
    at require (E:\mywork\auto\node_modules\natives\index.js:110:12)
    at fs.js:42:21
    at req_ (E:\mywork\auto\node_modules\natives\index.js:137:5)
    at Object.req [as require] (E:\mywork\auto\node_modules\natives\index.js:54:10)
    at Object.<anonymous> (E:\mywork\auto\node_modules\vinyl-fs\node_modules\graceful-fs\fs.js:1:37)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test@1.0.0 dev: `gulp watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the test@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

 

问题原因

这个问题是我将node版本升级至v10.15.0,npm升级至6.4.1后出现的,在此之前,我的node版本是8+,没有出现这个问题。

 

解决方案

npm install natives@1.1.6

下载成功后,再次运行,问题得到解决!

腾讯云限量秒杀

1核2G 5M 50元/年 2核4G 8M 74元/年 4核8G 5M 818元/年 CDN流量包 100GB 9元

版权声明

本站部分原创文章,部分文章整理自网络。如有转载的文章侵犯了您的版权,请联系站长删除处理。如果您有优质文章,欢迎发稿给我们!联系站长:
愿本站的内容能为您的学习、工作带来绵薄之力。

评论

  • 随机获取
点击刷新
精彩评论

友情链接