我应该首先指出,我是一个没有经验的用户,我的问题是,'hostname'属性除了一个空字符串(‘)、'0.0.0.0’和'localhost‘之外,不能有任何赋值。I getting:致命错误: getaddrinfo ENOTFOUND。我做错什么了?
如果正确的话,我可以更改我通常在地址栏中输入的地址,所以我可以键入'example.com‘或类似的东西。
正如我前面提到的,我给它分配了不同的值,但其中只有三个有效。所以为什么这个“*”不起作用。
这是我的Gruntfile.js
module.exports = function( grunt ) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
scripts: {
files: ['*.js'],
options: {
livereload: true
}
},
markup: {
files: ['*.html'],
options: {
livereload: true
}
},
stylesheets: {
files: ['*.css'],
options: {
livereload: true
}
}
},
connect: {
server: {
options: {
hostname: '*',
port: 2000,
base: '.'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('default', ['connect','watch']);
};Ubuntu 12.04 64位的工作
NodeJs 0.10.17
国家预防机制1.3.8
GruntJs 0.4.1
格朗特-控制-连接0.3.0
发布于 2013-08-24 21:38:57
这是因为grunt试图以服务器的形式绑定到该地址。无法将服务器绑定到任意IP地址或域名。
https://stackoverflow.com/questions/18422697
复制相似问题