动手和最佳实践是学习一门语言或框架的最佳方式。
分享node-blog-starter,使用Express + Mongoose + Ejs实现的个人博客系统。
我是刚学Node.js的新手,写得不好的地方还请大帮忙之处,谢谢。
最后,希望能够帮到有需要的同学〜
同楼主一样,大三学生一枚,同样推荐一个吧,曾在社区有人推荐过的 https://github.com/nswbmw/N-blog 看完这个,我现在在看cnode社区的开源项目 https://github.com/cnodejs/nodeclub/
我npm install bcrypt 出错
npm ERR! bcrypt@0.8.0 install: node-gyp rebuild
npm ERR! Exit status 139
npm ERR!
npm ERR! Failed at the bcrypt@0.8.0 install script.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 13.2.0 npm ERR! command "node" "/usr/local/bin/npm" "install" "bcrypt" npm ERR! cwd /Users/harvey850331/Sites/Harvey-nodejsblog npm ERR! node -v v0.8.2 npm ERR! npm -v 1.4.21 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/harvey850331/Sites/Harvey-nodejsblog/npm-debug.log npm ERR! not ok code 0 找不到原因 请教一下
前几天这个问题,update了一下nodejs就好了。 再问下我看到这个在html页面中的 local.marked(),这个方法是如何设置的,有些页面能显示,有些页面说未定义。万分感谢
@HanweiHuang locals是拿来设置全局助手函数的,然后你就可以在模板中使用这个函数了。
// app.js
var app = express();
app.locals.moment= require('moment');
我的也出错了 module.js:340 throw err; ^ Error: Cannot find module 'express’ at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (e:\nodeBlog\app.js:6:15) at Module._compile (module.js:456:26) at Object.Module._extensions...js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10)