访问http://sailsjs.org/#!getStarted并完成页面要求的步骤。在我的 Win7 环境中,我运行并测试了节点。我安装了sails.js,更改了目录和“sails lift”。Sails.js 成功启动,CLI 如下所示:
$ sails lift
info:
info:
info: Sails.js <|
info: v0.9.7 |\
info: /|.\
info: / || \
info: ,' |' \
info: .-'.-==|/_--'
info: `--'-------'
info: __---___--___---___--___---___--___
info: ____---___--___---___--___---___--___-__
info:
info: Server lifted in `c:\Users\Dad\My Documents\Aptana Studio 3 Workspace\First Sails Project\t
estProject`
info: To see your app, visit http://localhost:1337
info: To shut down Sails, press <CTRL> + C at any time.
debug: --------------------------------------------------------
debug: :: Wed Nov 06 2013 14:06:25 GMT-0500 (Eastern Standard Time)
debug:
debug: Environment : development
debug: Port : 1337
debug: --------------------------------------------------------
但是当我访问端口时,我在页面上得到了这个:
{
"status": 500,
"errors": [
"Failed to lookup view \"home/index\""
]
}
在 CLI 上有很长的跟踪开始:
error: Error rendering view at :: c:\Users\Dad\My Documents\Aptana Studio 3 Workspace\First Sails
Project\testProject/views/home/index
error: Using layout located at :: c:\Users\Dad\My Documents\Aptana Studio 3 Workspace\First Sails
Project\testProject/views/layout
error: Server Error (500)
error: Error: Failed to lookup view "home/index"
at Function.app.render (c:\Users\Dad\AppData\Roaming\npm\node_modules\sails\node_modules\expr
ess\lib\application.js:495:17)
.
.
.
Sails.js 的全局安装运行良好。所有文件都存在于视图目录中。我正在运行 node v0.8.18 和其他运行/渲染良好的应用程序。查看“config”目录中的“500.js”文件,如果“视图不存在,只需发送 json”(这似乎正在发生)。但是这种观点似乎确实存在,所以......我错过了什么?