在新创建的sails.js应用程序中找不到视图 - 在Windows 7 sp1,64bit上运行node.js.

时间:2013-10-20 06:10:03

标签: sails.js

在这个问题上绞尽脑汁,没有运气。我之前已经在我的ubuntu盒子和Windows 8上做了好几次,从来没有遇到过问题。

有人可以帮我弄清楚为什么我会收到这些错误吗?我意识到这通常意味着无法找到视图,但新生成的应用程序通常只能工作。

config / views.js默认包含ejs引擎,并且views / home / index.ejs中的文件存在(与views / layout.ejs中的文件一样)。还检查了路线并将其设置为

'/': {
    view: 'home/index'
  }


Here's the startup info and stack trace... Thanks :)
error: Error rendering view at :: C:\apps\mean\testIt/views/home/index
error: Using layout located at :: C:\apps\mean\testIt/views/layout
error: Server Error (500)
error: Error: Failed to lookup view "home/index"

On a newly created sails.js app. Created app using sails new testIt
running node v0.10.21 on windows 7 64bit sp1, sails.js version 0.9.7


Details: 

C:\apps\mean\testIt>sails lift
info:
info:
info:    Sails.js           <|
info:    v0.9.7              |\
info:                       /|.\
info:                      / || \
info:                    ,'  |'  \
info:                 .-'.-==|/_--'
info:                 `--'-------'
info:    __---___--___---___--___---___--___
info:  ____---___--___---___--___---___--___-__
info:
info: Server lifted in `C:\apps\mean\testIt`
info: To see your app, visit http://localhost:1337
info: To shut down Sails, press <CTRL> + C at any time.

debug: --------------------------------------------------------
debug: :: Sat Oct 19 2013 22:51:22 GMT-0700 (Pacific Daylight Time)
debug:
debug: Environment      : development
debug: Port             : 1337
debug: --------------------------------------------------------
error: Error rendering view at :: C:\apps\mean\testIt/views/home/index
error: Using layout located at :: C:\apps\mean\testIt/views/layout
error: Server Error (500)
error: Error: Failed to lookup view "home/index"
    at Function.app.render (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\
node_modules\express\lib\application.js:495:17)
    at ServerResponse.res.render (C:\Users\dan\AppData\Roaming\npm\node_modules\
sails\node_modules\express\lib\response.js:798:7)
    at ServerResponse._addResViewMethod.res.view (C:\Users\dan\AppData\Roaming\n
pm\node_modules\sails\lib\hooks\views\index.js:297:15)
    at serveView (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\lib\hooks\
views\index.js:187:9)
    at wrapperFn (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\lib\router
\bind.js:271:5)
    at _bind.enhancedFn (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\lib
\router\bind.js:375:4)
    at callbacks (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\lib\router\index.js:164:37)
    at param (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\e
xpress\lib\router\index.js:138:11)
    at pass (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\ex
press\lib\router\index.js:145:5)
    at nextRoute (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\lib\router\index.js:100:7)
    at callbacks (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\lib\router\index.js:167:11)
    at rememberViewId (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\lib\h
ooks\views\index.js:184:5)
    at wrapperFn (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\lib\router
\bind.js:271:5)
    at _bind.enhancedFn (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\lib
\router\bind.js:375:4)
    at callbacks (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\lib\router\index.js:164:37)
    at param (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\e
xpress\lib\router\index.js:138:11)
    at pass (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\ex
press\lib\router\index.js:145:5)
    at nextRoute (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\lib\router\index.js:100:7)
    at callbacks (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\lib\router\index.js:167:11)
    at C:\Users\dan\AppData\Roaming\npm\node_modules\sails\lib\hooks\i18n\index.
js:27:13
    at Object.i18nInit [as init] (C:\Users\dan\AppData\Roaming\npm\node_modules\
sails\node_modules\i18n\i18n.js:80:5)
    at routes.before./* (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\lib
\hooks\i18n\index.js:25:16)
    at _bind.enhancedFn (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\lib
\router\bind.js:375:4)
    at callbacks (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\lib\router\index.js:164:37)
    at param (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\e
xpress\lib\router\index.js:138:11)
    at pass (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\ex
press\lib\router\index.js:145:5)
    at nextRoute (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\lib\router\index.js:100:7)
    at callbacks (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\lib\router\index.js:167:11)
    at routes.before./* (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\lib
\hooks\csrf\index.js:35:6)
    at _bind.enhancedFn (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\lib
\router\bind.js:375:4)
    at callbacks (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\lib\router\index.js:164:37)
    at param (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\e
xpress\lib\router\index.js:138:11)
    at pass (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\ex
press\lib\router\index.js:145:5)
    at nextRoute (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\lib\router\index.js:100:7)
    at callbacks (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\lib\router\index.js:167:11)
    at _addResViewMethod (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\li
b\hooks\views\index.js:337:3)
    at _bind.enhancedFn (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\lib
\router\bind.js:375:4)
    at callbacks (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\lib\router\index.js:164:37)
    at param (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\e
xpress\lib\router\index.js:138:11)
    at pass (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\ex
press\lib\router\index.js:145:5)
    at nextRoute (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\lib\router\index.js:100:7)
    at callbacks (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\lib\router\index.js:167:11)
    at addSugarMethods (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\lib\
hooks\request\index.js:68:6)
    at _bind.enhancedFn (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\lib
\router\bind.js:375:4)
    at callbacks (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\lib\router\index.js:164:37)
    at param (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\e
xpress\lib\router\index.js:138:11)
    at pass (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\ex
press\lib\router\index.js:145:5)
    at nextRoute (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\lib\router\index.js:100:7)
    at callbacks (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\lib\router\index.js:167:11)
    at C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\connect-
flash\lib\flash.js:21:5
    at supportFlashMsgs (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\lib
\hooks\request\index.js:45:32)
    at _bind.enhancedFn (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\lib
\router\bind.js:375:4)
    at callbacks (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\lib\router\index.js:164:37)
    at param (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\e
xpress\lib\router\index.js:138:11)
    at pass (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\ex
press\lib\router\index.js:145:5)
    at Router._dispatch (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\nod
e_modules\express\lib\router\index.js:173:5)
    at Object.router (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_m
odules\express\lib\router\index.js:33:10)
    at next (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\ex
press\node_modules\connect\lib\proto.js:190:15)
    at Object.handle (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\lib\ex
press\index.js:168:4)
    at next (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\ex
press\node_modules\connect\lib\proto.js:190:15)
    at Object.methodOverride [as handle] (C:\Users\dan\AppData\Roaming\npm\node_
modules\sails\node_modules\express\node_modules\connect\lib\middleware\methodOve
rride.js:49:5)
    at next (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\ex
press\node_modules\connect\lib\proto.js:190:15)
    at C:\Users\dan\AppData\Roaming\npm\node_modules\sails\lib\express\bodyParse
rRetry.js:46:4
    at multipart (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\node_modules\connect\lib\middleware\multipart.js:85:37)
    at C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\express\
node_modules\connect\lib\middleware\bodyParser.js:57:9
    at urlencoded (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modu
les\express\node_modules\connect\lib\middleware\urlencoded.js:49:37)
    at C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\express\
node_modules\connect\lib\middleware\bodyParser.js:55:7
    at json (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\ex
press\node_modules\connect\lib\middleware\json.js:43:37)
    at bodyParser (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modu
les\express\node_modules\connect\lib\middleware\bodyParser.js:53:5)
    at Object.retryBodyParser [as handle] (C:\Users\dan\AppData\Roaming\npm\node
_modules\sails\lib\express\bodyParserRetry.js:36:36)
    at next (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\ex
press\node_modules\connect\lib\proto.js:190:15)
    at next (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\ex
press\node_modules\connect\lib\proto.js:192:9)
    at multipart (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modul
es\express\node_modules\connect\lib\middleware\multipart.js:85:37)
    at C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\express\
node_modules\connect\lib\middleware\bodyParser.js:57:9
    at urlencoded (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modu
les\express\node_modules\connect\lib\middleware\urlencoded.js:49:37)
    at C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\express\
node_modules\connect\lib\middleware\bodyParser.js:55:7
    at json (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\ex
press\node_modules\connect\lib\middleware\json.js:43:37)
    at bodyParser (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modu
les\express\node_modules\connect\lib\middleware\bodyParser.js:53:5)
    at Object.handle (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\lib\ex
press\index.js:118:12)
    at next (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\ex
press\node_modules\connect\lib\proto.js:190:15)
    at next (C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\ex
press\node_modules\connect\lib\middleware\session.js:312:9)
    at C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\express\
node_modules\connect\lib\middleware\session.js:329:9
    at C:\Users\dan\AppData\Roaming\npm\node_modules\sails\node_modules\express\
node_modules\connect\lib\middleware\session\memory.js:55:7
    at process._tickDomainCallback (node.js:459:13)

1 个答案:

答案 0 :(得分:3)

我在win 8&amp ;;中遇到了同样的错误帆0.9.7。作为临时解决方案,我能够使用帆船0.9.4。 npm install sails@0.9.4