我在这里遵循了(非常简单的)说明:http://sailsjs.org/get-started .
但是,当我尝试运行 sails lift
时,它只是给了我一个空白页面,因为我的 grunt 安装有问题。我重新安装了它,修复了错误,但现在当我访问 localhost:1337
时仍然有一个空白页面。我知道 某事 正在工作,因为当我停止运行 sails lift
时,我什至没有看到空白页面,但我没有看到预期的 主页。 ejs
.
当我运行 sails lift
时我的输出是:
sails lift
info: Starting app...
info:
info: .-..-.
info:
info: Sails <| .-..-.
info: v0.11.0 |\
info: /|.\
info: / || \
info: ,' |' \
info: .-'.-==|/_--'
info: `--'-------'
info: __---___--___---___--___---___--___
info: ____---___--___---___--___---___--___-__
info:
info: Server lifted in `C:\Users\Me\WebstormProjects\GameWorldCraft`
info: To see your app, visit http://localhost:1337
info: To shut down Sails, press <CTRL> + C at any time.
debug: --------------------------------------------------------
debug: :: Sat Aug 22 2015 12:24:00 GMT-0700 (Pacific Daylight Time)
debug: Environment : development
debug: Port : 1337
debug: --------------------------------------------------------
info: Gruntfile could not be found.
info: (no grunt tasks will be run.)
最后两行似乎是问题所在,但我不知道如何解决。任何帮助将不胜感激。
最佳答案
我猜你的 sails 安装失败是出于某种原因。
npm uninstall sails
npm cache clear
npm install sails
如果这不起作用,请进入您的 app/node_modules/sails 目录,然后运行:
npm install grunt-cli
(在某些情况下,您可能已经全局安装了 grunt CLI,但它会妨碍您。)
关于javascript - `sails lift` 上的 Grunt 错误和空白页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32159997/