背景:
前几天修改了一个早期底层仓库的代码,需要 gulp 编译一下,结果失败了,如下:
gulp
ReferenceError: internalBinding is not defined
at internal/util/inspect.js:31:15
环境
node 版本:10.15.0 (为编译此工程,降级为 10. 版本)
gulp:3.9.1
问题原因:node 10.15.0 和 gulp 3.9.1 的兼容问题
解决方案:安装 natives@1.1.6
npm install natives -D 或 npm install natives --save-dev 写入 devDependencies 即可
npm install natives -D
npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
WARN tarball tarball data for fsevents@1.1.3 (sha1-EfgjGPX+e7LNIpZaEI6TBiCCFtg=) seems to be corrupted. Trying one more time.8ms
WARN tarball tarball data for fsevents@1.1.3 (sha1-EfgjGPX+e7LNIpZaEI6TBiCCFtg=) seems to be corrupted. Trying one more time.8ms
npm WARN ajv-keywords@3.1.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN gulp-imagemin@7.1.0 requires a peer of gulp@>=4 but none is installed. You must install peer dependencies yourself.
npm WARN joywok-business-components@0.1.6 No description
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Verification failed while extracting fsevents@1.1.3:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Verification failed while extracting fsevents@1.1.3:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sha1-EfgjGPX+e7LNIpZaEI6TBiCCFtg= integrity checksum failed when using sha1: wanted sha1-EfgjGPX+e7LNIpZaEI6TBiCCFtg= but got sha512-+ux3lx6peh0BpvY0JebGyZoiR4D+oYzdPZMKJwkZ+sFkNJzpL7tXc/wehS49gUAxg3tmMHPHZkA8JU2rhhgDHw== sha1-Z79X9HWPAu3oj7KhcS/vTRU1i+M=. (649719 bytes)
+ natives@1.1.6
updated 1 package in 10.513s