去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的全局安装很顺利。所有文件都存在于views目录中。我正在运行节点v0.8.18和我运行/渲染的其他应用程序。查看'config'目录中的'500.js'文件,如果'视图不存在,只需发送json'(这似乎正在发生)。但这种观点确实存在,所以......我错过了什么?