ReferenceError:未定义internalBinding

时间:2019-03-09 13:56:48

标签: node.js asp.net-core npm gulp aspnetboilerplate

在ASP.NET零5.x中,npm run create-bundles失败。

我正在基于ASP.NET Boilerplate框架的ASP.NET Zero的ASP.NET Core MVC + jQuery基本解决方案上构建许可项目。这不是一个新项目,而是一个过去已经成功构建并运行的现有项目。

我已遵循Getting started guide的要求确保安装了以下内容:

  • nodejs(v10.15.3)+ npm(v6.4.1)
  • gulp-确保我已全局安装(cli版本2.0.1本地版本3.9.1)
  • 纱线(v1.13.0)
  • 捆绑程序和压缩程序Visual Studio扩展(最新)

然后按照指南运行yarn(两次-第一次,我收到错误消息),结果如下:

enter image description here

尝试运行npm run create-bundles会给我以下错误消息:

enter image description here

根据以下屏幕截图,似乎没有生成我的所有缩小JavaScript文件:

enter image description here

如何使npm run create-bundles成功运行?

更新

npm run full-build不起作用,并产生以下输出:

enter image description here enter image description here

2 个答案:

答案 0 :(得分:1)

  
      
  • nodejs(v10.15.3)...
  •   
  • gulp ... 3.9.1
  •   

这是Node.js 10.14.2+上的gulp.js 3.9.1的问题。 1

这些是您的选择,按照推荐的顺序:

  1. 升级gulpnpm install gulp@^4 1 -对于ASP.NET Zero,请升级到ASP.NET Zero 6.3.1 +。
  2. 安装特定版本的nativesnpm install natives@1.1.6 2
  3. 降级到Node.js 10.14.1 3

参考文献

  1. https://github.com/nodejs/node/issues/24985#issuecomment-447241752
  2. https://github.com/gulpjs/gulp/issues/2246#issuecomment-435646661
  3. https://github.com/nodejs/node/issues/24985#issuecomment-449124867

答案 1 :(得分:0)

只需将gulp版本更新为3.9.1,并且此版本支持Node.js最新版本。

npm install gulp@3.9.1
相关问题