Node.js   发布时间:2022-04-24  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了gruntjs – grunt-contrib-connect错误:中间件未定义大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在为我的AngularJS应用程序使用yeoman的角度生成器.这个生成包括grunt和grunt-contrib-connect,它们非常有用……但是依赖项已经过时了,所以我决定更新它们.

这样做时,我有一个grunt-contrib-connect错误,这是我使用–verbose选项的时候:

Running "connect:test" (connect) task
Verifying property connect.test exists in config...oK
File: [no files]
Options: protocol="http",port=9001,hostname="localhost",base=".",directory=null,keepalive=false,debug=false,livereload=35729,open=false,useAvailablePort=false,onCreateServer=null,middleware=undefined
Warning: undefined is not a function Use --force to conTinue.

Aborted due to warnings.

所以似乎中间件负责这个问题,这里是:

@H_134_9@middleware: function (connect) { return [ connect.static('.tmp'),connect.static('test'),connect().use( '/bower_components',connect.static('./bower_components') ),connect.static(appConfig.app) ]; }

任何帮助我解决这个问题的帮助都非常受欢迎:)

解决方法

使用grunt-contrib-connect版本0.10.1似乎可以解决这个问题. Issue 161可能是相关的.

大佬总结

以上是大佬教程为你收集整理的gruntjs – grunt-contrib-connect错误:中间件未定义全部内容,希望文章能够帮你解决gruntjs – grunt-contrib-connect错误:中间件未定义所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。