Steps by step guide to clone HowToNode node.js Git Repo and run locally

 

Be sure to install Git for Windows from the link below with the following install setting:

–           http://code.google.com/p/msysgit/downloads/list

–           Use Windows Command Line Interface

–           Check Git is in your path

–           Try to execute the git  command

 

Now create a folder where you would want to create node blog i.e. (C:AzureNodeprojectsavkashblog)

 

Run the git command to clone howtonode repo https://github.com/creationix/howtonode.org

 

C:Azurenodeprojectsavkashblog>git clone https://github.com/creationix/howtonode.org

Cloning into ‘howtonode.org’…

remote: Counting objects: 2606, done.

remote: Compressing objects: 100% (1061/1061), done.

remote: Total 2606 (delta 1592), reused 2512 (delta 1507)

Receiving objects: 100% (2606/2606), 2.65 MiB | 559 KiB/s, done.

Resolving deltas: 100% (1592/1592), done.

 

C:Azurenodeprojectsavkashblog>dir howtonode.org

Volume in drive C has no label.

Volume Serial Number is 8464-7B7C

 

Directory of C:Azurenodeprojectsavkashbloghowtonode.org

 

01/21/2012  08:19 PM    <DIR>          .

01/21/2012  08:19 PM    <DIR>          ..

01/21/2012  08:19 PM                21 .gitignore

01/21/2012  08:19 PM               421 .gitmodules

01/21/2012  08:19 PM    <DIR>          articles

01/21/2012  08:19 PM    <DIR>          authors

01/21/2012  08:19 PM               760 description.markdown

01/21/2012  08:19 PM               527 package.json

01/21/2012  08:19 PM             1,704 README.markdown

01/21/2012  08:19 PM    <DIR>          server

01/21/2012  08:19 PM    <DIR>          skin

5 File(s)          3,433 bytes

6 Dir(s)  33,201,917,952 bytes free

 

It is always good idea to take a look at package.json to see the dependency and if there are any dependency then you can run “npm install –d” to install all the dependencies for your project.

Reading the Package.json as below:

 

{

“author”: “Tim Caswell <tim@creationix.com> (http://creationix.com/)”,

“name”: “howtonode.org”,

“description”: “The popular blog howto.no.de”,

“version”: “0.0.0”,

“homepage”: “http://howto.no.de/&#8221;,

“repository”: {

“type”: “git”,

“url”: “git://github.com/creationix/howtonode.org.git”

},

“engines”: {

“node”: “>=0.4.0”

},

“dependencies”: {

“stack”: “>=0.0.3”,

    “creationix”: “>=0.1.2”,

    “wheat”: “>=0.2.0”,

    “cluster”: “>=0.6.4”

},

“devDependencies”: {}

}

 

Based on above you can see there are 4 dependencies 1) stack 2) creationix 3) wheat 4) cluster

 

Now you can run “npm install –d” command to install all the dependencies.

 

C:Azurenodeprojectsavkashbloghowtonode.org>npm install -d

npm info it worked if it ends with ok

npm info using npm@1.1.0-beta-10

npm info using node@v0.6.7

npm info preinstall howtonode.org@0.0.0

npm http GET https://registry.npmjs.org/wheat

npm http GET https://registry.npmjs.org/creationix

npm http GET https://registry.npmjs.org/stack

npm http GET https://registry.npmjs.org/cluster

npm http 304 https://registry.npmjs.org/stack

npm http 304 https://registry.npmjs.org/creationix

npm http 304 https://registry.npmjs.org/wheat

npm http 304 https://registry.npmjs.org/cluster

npm info into C:Azurenodeprojectsavkashbloghowtonode.org stack@0.1.0

npm info into C:Azurenodeprojectsavkashbloghowtonode.org wheat@0.2.5

npm info into C:Azurenodeprojectsavkashbloghowtonode.org creationix@0.3.1

npm info into C:Azurenodeprojectsavkashbloghowtonode.org cluster@0.7.7

npm info installOne stack@0.1.0

npm info installOne wheat@0.2.5

npm info installOne creationix@0.3.1

npm info installOne cluster@0.7.7

npm info unbuild C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulesstack

npm info unbuild C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheat

npm info unbuild C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulescreationix

npm info unbuild C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulescluster

npm info preinstall stack@0.1.0

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulesstack

npm info linkStuff stack@0.1.0

npm info install stack@0.1.0

npm info postinstall stack@0.1.0

npm info preinstall creationix@0.3.1

npm http GET https://registry.npmjs.org/simple-mime

npm info preinstall wheat@0.2.5

npm http GET https://registry.npmjs.org/haml

npm http GET https://registry.npmjs.org/step

npm http GET https://registry.npmjs.org/datetime/0.0.3

npm http GET https://registry.npmjs.org/proto

npm http GET https://registry.npmjs.org/git-fs

npm info preinstall cluster@0.7.7

npm http GET https://registry.npmjs.org/log

npm http GET https://registry.npmjs.org/mkdirp

npm http 304 https://registry.npmjs.org/simple-mime

npm http 304 https://registry.npmjs.org/haml

npm info into C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulescreationix simple-mime@0.0.4

npm info installOne simple-mime@0.0.4

npm info unbuild C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulescreationixnode_modulessimple-mime

npm info preinstall simple-mime@0.0.4

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulescreationixnode_modulessimple-mime

npm info linkStuff simple-mime@0.0.4

npm info install simple-mime@0.0.4

npm info postinstall simple-mime@0.0.4

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulescreationix

npm info linkStuff creationix@0.3.1

npm info install creationix@0.3.1

npm info postinstall creationix@0.3.1

npm http 304 https://registry.npmjs.org/proto

npm http 304 https://registry.npmjs.org/datetime/0.0.3

npm http 304 https://registry.npmjs.org/step

npm http 304 https://registry.npmjs.org/log

npm http 304 https://registry.npmjs.org/git-fs

npm info into C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheathaml@0.4.2

npm info into C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatsimple-mime@0.0.4

npm info into C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatproto@0.1.0

npm info into C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatdatetime@0.0.3

npm info into C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatstep@0.0.5

npm info into C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatgit-fs@0.0.7

npm info installOne haml@0.4.2

npm info installOne simple-mime@0.0.4

npm info installOne proto@0.1.0

npm info installOne datetime@0.0.3

npm info installOne step@0.0.5

npm info installOne git-fs@0.0.7

npm info unbuild C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatnode_moduleshaml

npm info unbuild C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatnode_modulessimple-mime

npm info unbuild C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatnode_modulesproto

npm info unbuild C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatnode_modulesdatetime

npm info unbuild C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatnode_modulesstep

npm info unbuild C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatnode_modulesgit-fs

npm http 304 https://registry.npmjs.org/mkdirp

npm info into C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulescluster log@1.2.0

npm info into C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulescluster mkdirp@0.3.0

npm info installOne log@1.2.0

npm info installOne mkdirp@0.3.0

npm info preinstall simple-mime@0.0.4

npm info unbuild C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulesclusternode_moduleslog

npm info unbuild C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulesclusternode_modulesmkdirp

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatnode_modulessimple-mime

npm info linkStuff simple-mime@0.0.4

npm info install simple-mime@0.0.4

npm info postinstall simple-mime@0.0.4

npm info preinstall proto@0.1.0

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatnode_modulesproto

npm info linkStuff proto@0.1.0

npm info install proto@0.1.0

npm info postinstall proto@0.1.0

npm info preinstall git-fs@0.0.7

npm info preinstall datetime@0.0.3

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatnode_modulesgit-fs

npm info linkStuff git-fs@0.0.7

npm info install git-fs@0.0.7

npm info postinstall git-fs@0.0.7

npm http GET https://registry.npmjs.org/vows

npm info preinstall step@0.0.5

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatnode_modulesstep

npm info linkStuff step@0.0.5

npm info install step@0.0.5

npm info postinstall step@0.0.5

npm info preinstall log@1.2.0

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulesclusternode_moduleslog

npm info linkStuff log@1.2.0

npm info install log@1.2.0

npm info postinstall log@1.2.0

npm info preinstall mkdirp@0.3.0

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulesclusternode_modulesmkdirp

npm info linkStuff mkdirp@0.3.0

npm info install mkdirp@0.3.0

npm info postinstall mkdirp@0.3.0

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulescluster

npm info linkStuff cluster@0.7.7

npm info install cluster@0.7.7

npm info postinstall cluster@0.7.7

npm info preinstall haml@0.4.2

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatnode_moduleshaml

npm info linkStuff haml@0.4.2

npm info install haml@0.4.2

npm info postinstall haml@0.4.2

npm http 304 https://registry.npmjs.org/vows

npm info into C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatnode_modulesdatetime vows@0.6.1

npm info installOne vows@0.6.1

npm info unbuild C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatnode_modulesdatetimenode_modulesvows

npm info preinstall vows@0.6.1

npm http GET https://registry.npmjs.org/eyes

npm http 304 https://registry.npmjs.org/eyes

npm WARN eyes@0.1.7 dependencies field should be hash of <name>:<version-range>

pairs

npm info into C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheat

node_modulesdatetimenode_modulesvows eyes@0.1.7

npm info installOne eyes@0.1.7

npm info unbuild C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatnode_modulesdatetimenode_modulesvowsnode_moduleseyes

npm info preinstall eyes@0.1.7

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatnode_modulesdatetimenode_modulesvowsnode_moduleseyes

npm info linkStuff eyes@0.1.7

npm info install eyes@0.1.7

npm info postinstall eyes@0.1.7

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatnode_modulesdatetimenode_modulesvows

npm info linkStuff vows@0.6.1

npm info install vows@0.6.1

npm info postinstall vows@0.6.1

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheatnode_modulesdatetime

npm info linkStuff datetime@0.0.3

npm info install datetime@0.0.3

npm info postinstall datetime@0.0.3

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheat

npm info linkStuff wheat@0.2.5

npm info install wheat@0.2.5

npm info postinstall wheat@0.2.5

npm info build C:Azurenodeprojectsavkashbloghowtonode.org

npm info linkStuff howtonode.org@0.0.0

npm info install howtonode.org@0.0.0

npm info postinstall howtonode.org@0.0.0

stack@0.1.0 ./node_modules/stack

creationix@0.3.1 ./node_modules/creationix

└── simple-mime@0.0.4

cluster@0.7.7 ./node_modules/cluster

├── log@1.2.0

└── mkdirp@0.3.0

wheat@0.2.5 ./node_modules/wheat

├── simple-mime@0.0.4

├── proto@0.1.0

├── git-fs@0.0.7

├── step@0.0.5

├── haml@0.4.2

└── datetime@0.0.3

npm info ok

 

 

After all the dependencies are installed you can also try to install dependencies for the dependent components.

 

Checking dependencies for wheat:

 

C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheat>npm install -d

 

npm info it worked if it ends with ok

npm info using npm@1.1.0-beta-10

npm info using node@v0.6.7

npm info preinstall wheat@0.2.5

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_moduleswheat

 

npm info linkStuff wheat@0.2.5

npm info install wheat@0.2.5

npm info postinstall wheat@0.2.5

 

npm info ok

 

Checking dependencies for cluster:

 

C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulescluster>npm install -d

npm info it worked if it ends with ok

npm info using npm@1.1.0-beta-10

npm info using node@v0.6.7

npm info preinstall cluster@0.7.7

npm http GET https://registry.npmjs.org/should

npm http 200 https://registry.npmjs.org/should

npm http GET https://registry.npmjs.org/should/-/should-0.2.1.tgz

npm http 200 https://registry.npmjs.org/should/-/should-0.2.1.tgz

npm info shasum 5456ca01063d3abeb26b9fe4c918c517deee058d

npm info shasum C:UsersavkashcAppDataLocalTempnpm-13272063206331327206320

633-0.4006785706151277tmp.tgz

npm info shasum 05e57b5442819a362721b32b713ee680fce94f01

npm info shasum C:UsersavkashcAppDataRoamingnpm-cacheshould.2.1package.tgz

npm info into C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulescluster should@0.2.1

npm info installOne should@0.2.1

npm info unbuild C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulesclusternode_modulesshould

npm info preinstall should@0.2.1

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulesclusternode_modulesshould

npm info linkStuff should@0.2.1

npm info install should@0.2.1

npm info postinstall should@0.2.1

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulescluster

npm info linkStuff cluster@0.7.7

npm info install cluster@0.7.7

npm info postinstall cluster@0.7.7

should@0.2.1 ./node_modules/should

npm info ok

 

Checking dependencies for creationix

 

C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulescreationix>npm install -d

npm info it worked if it ends with ok

npm info using npm@1.1.0-beta-10

npm info using node@v0.6.7

npm info preinstall creationix@0.3.1

npm http GET https://registry.npmjs.org/stack

npm http 304 https://registry.npmjs.org/stack

npm info into C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulescreationix stack@0.1.0

npm info installOne stack@0.1.0

npm info unbuild C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulescreationixnode_modulesstack

npm info preinstall stack@0.1.0

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulescreationixnode_modulesstack

npm info linkStuff stack@0.1.0

npm info install stack@0.1.0

npm info postinstall stack@0.1.0

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulescreationix

npm info linkStuff creationix@0.3.1

npm info install creationix@0.3.1

npm info postinstall creationix@0.3.1

stack@0.1.0 ./node_modules/stack

npm info ok

 

Checking dependencies for stack:

 

C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulesstack>npm install -d

 

npm info it worked if it ends with ok

npm info using npm@1.1.0-beta-10

npm info using node@v0.6.7

npm info preinstall stack@0.1.0

npm info build C:Azurenodeprojectsavkashbloghowtonode.orgnode_modulesstack

 

npm info linkStuff stack@0.1.0

npm info install stack@0.1.0

npm info postinstall stack@0.1.0

 

npm info ok

 

If you look serverserver.js, you will see the web server start code is already there as below:

// Just a basic server setup for this site

var Stack = require(‘stack’),

Creationix = require(‘creationix’),

Http = require(‘http’);

 

Http.createServer(Stack(

Creationix.log(),

require(‘wheat’)(process.env.JOYENT ? process.env.HOME + “/howtonode” : __dirname +”/..”)

)).listen(process.env.JOYENT ? 80 : 8080);

 

Because all the articles are stored in article folder so edit

 

skinindex.haml as below:

#main.index

:each article in articles.slice(0,15)

.article

.author

%img{src:gravitar(article.author.email, 30)}

By #{article.author.name}

.date{title: article.date}&= formatDate(article.date, “%Y.%m.%d”)

%h3

%a{href: “/articles/” + article.name}&= article.title

= intro(article.markdown)

%a.more{href: “/articles/” + article.name} Read more…

 

#sidebar

.aside

= markdownEncode(description)

.bubble

%h4

Articles

%ul

:each article in articles.slice(0,20)

%li

%a{href: “/articles/” + article.name}&=article.title

&=” by ” + article.author.name

:if article.node

%span.versiontag&= article.node

.bubble= markdownEncode(description)

 

 

To launch the web server just try:

C:Azurenodeprojectsavkashbloghowtonode.orgserver>node server.js

GET / 200 Content-Type=text/html; charset=utf-8 Content-Length=24235

GET /style.css 200 Content-Type=text/css Content-Length=11613

GET /groovepaper.png 200 Content-Type=image/png Content-Length=40723

GET /print.css 200 Content-Type=text/css Content-Length=254

GET / 200 Content-Type=text/html; charset=utf-8 Content-Length=24235

GET /style.css 200 Content-Type=text/css Content-Length=11613

GET /groovepaper.png 200 Content-Type=image/png Content-Length=40723

GET /print.css 200 Content-Type=text/css Content-Length=254

GET /articles/testing-private-state-and-mocking-deps 404 Content-Type=text/plain

 

GET /favicon.ico 200 Content-Type=image/vnd.microsoft.icon Content-Length=1469

GET /favicon.ico 200 Content-Type=image/vnd.microsoft.icon Content-Length=1469

GET /articles/testing-private-state-and-mocking-deps 404 Content-Type=text/plain

 

GET /articles/promises 404 Content-Type=text/plain

GET /articles/promises 404 Content-Type=text/plain

GET /favicon.ico 200 Content-Type=image/vnd.microsoft.icon Content-Length=1469

 

Finally launch the browser and test the site at http://127.0.0.1:8080 as below:

 

 

 

Advertisements

2 thoughts on “Steps by step guide to clone HowToNode node.js Git Repo and run locally

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s