我正在尝试确定使用Windows预编译EmberJS模板的最佳方法,似乎找不到任何好的选择。
有人可以推荐一个经过验证的解决方案吗?
我正在使用Ember v 1.10.0
编辑: 我安装了最新版本的NodeJS,并按照此处的说明进行操作:http://www.ember-cli.com/#getting-started。
为了记录,我使用的是在Surface Pro 2上运行的Windows 8.1。
我尝试使用NodeJ安装Ember CLI,但我收到以下错误:
C:\>npm install -g ember-cli
npm WARN engine makeerror@1.0.10: wanted: {"node":"0.6.x"} (current: {"node":"0.
12.0","npm":"2.5.1"})
npm WARN engine tmpl@1.0.3: wanted: {"node":"0.6.x"} (current: {"node":"0.12.0",
"npm":"2.5.1"})
C:\Users\me\AppData\Roaming\npm\ember -> C:\Users\me\AppData\Roaming\npm
\node_modules\ember-cli\bin\ember
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "ember-cli"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package handlebars does not satisfy its siblings' peerD
ependencies requirements!
npm ERR! peerinvalid Peer ember-template-compiler@1.8.0 wants handlebars@~1
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "ember-cli"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! Uncaught, unspecified "error" event.
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\npm-debug.log
答案 0 :(得分:2)
这取决于您使用的工具/框架:
通常,无论您在服务器上使用什么(Node,Rails,Python,.Net,Java,...),您总能找到一个服务器端库来处理模板预编译。
我仍然建议尽可能使用Ember CLI(因为这是Ember的未来,而不仅仅是构建),然后将预编译的模板直接部署在IIS,Apache或(甚至更好的)Nginx之后。
如果您需要有关特定环境的更多详细信息,请与我们联系。