ã¤ã³ã¹ãã¼ã«ãç´ã
ããã°ã«ã®ã£ã¦ãéãã«ãã£ã¦ãåããªã
ExpressとWebSocketを使ったWebSocketのサンプルを作る準備 - 自分の感受性くらい
ããè¦ã¦ãexpressã¨ã試ãã¦ã¿ããã¨æã£ãã
Error: Cannot find module 'express'
The "sys" module is now called "util"
ãããªæãã®ã¨ã©ã¼ãåºã¦å
¨ãåããããexpressãããã£ãããNODE_PATHãéããããããããã£ã¦ã¿ããã©ãªããããããã¨æã£ã¦ãå
¬å¼ãã¼ã¸ã¸ã
macãªã®ã§pkgã使ãã°ããããã¨ãå®å®ç
node.js
ãè¦ãããæ®éã«pkgãããã¦ãã£ã¦ããããã¦ã³ãã¼ããã¦ãã¤ã³ã¹ãã¼ã«ãããnodeã¨npmãå
¥ã£ã¡ãã£ãã
$ node -v v0.6.9 $ npm -v 1.1.0-3
gitããã ã¨nodeã®ãã¼ã¸ã§ã³ãæ°ããããã®ããªã
ãã¨ã¯expressãã¤ã³ã¹ãã¼ã«ã
expressã¯railsã®generatorã¿ãããªæãã§ãµã³ãã«ã¢ããªä½ã£ã¦ãããã®ã§ãã³ãã³ãã©ã¤ã³ããéãããã«ãããã
$HOMEé
ä¸ã«.npmãä½ã£ã¦ããã®ä¸ã§expressãã¤ã³ã¹ãã¼ã«ã
$ cd $HOME/.npm $ npm install express
ããããã¨
~/.npm/node_modules/.bin é
ä¸ã«expressã®ã·ã³ããªãã¯ãªã³ã¯ãä½æãããã®ã§ã
.bash_profileã«
export PATH=$PATH:~/.npm/node_modules/.bin
ã追å ã
ãã§ã
$ . .bash_profile
ãã¨ã¯ã
$ express sample $ cd sample $ node app.js Express server listening on port 3000 in development mode
ã§ãããï¼ï¼