gpt4 book ai didi

sails.js - 在新创建的 Sails.js 应用程序中找不到 View - 在 Windows 7 sp1、64 位上运行 node.js

转载 作者:行者123 更新时间:2023-12-04 04:37:35 26 4
gpt4 key购买 nike

在这个问题上敲了一下我的头,没有运气。我之前在我的 ubuntu box 和 windows 8 上做过几次,从来没有出现过问题。

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

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)

最佳答案

我在 win 8 和sails 0.9.7 中遇到了同样的错误。作为一个临时解决方案,我能够让它与风帆 0.9.4 一起工作。 npm 安装风帆@0.9.4

关于sails.js - 在新创建的 Sails.js 应用程序中找不到 View - 在 Windows 7 sp1、64 位上运行 node.js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19474447/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com