我使用nitrous.io创建了一个节点环境。在他们的终端内,我安装了yeoman。如果我尝试运行,grunt server
我会收到一条错误消息:
Fatal error: Unable to find local grunt.
If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project. For more information about
installing and configuring grunt, please see the Getting Started guide:
http://gruntjs.com/getting-started
如果我去预览而不是连接到端口 3000 我得到这个
节点的参考状态将 127.0.0.1 或“localhost”更改为 0.0.0.0
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(3000, '0.0.0.0');
console.log('Server running at http://0.0.0.0:3000/');
服务器的 Grunt 语法有点不同
connect: {
options: {
port: 3000,
// Change this to '0.0.0.0' to access the server from outside.
hostname: '0.0.0.0' //
},
即使在此更改之后,错误仍然存在。grunt server
当我运行或去预览端口 3000时失败
关于我做错了什么的任何想法?如何运行我的 grunt 服务器以便在浏览器中看到我的站点?