node js basic question!!

63 views
Skip to first unread message

Nabayan Aich

unread,
Jul 1, 2014, 2:33:58 PM7/1/14
to nod...@googlegroups.com
hi, 
last night I have install nodejs and mongo db in Ubuntu VM. It was working fine but when i trying little more coding this morning, I m not able to run. In fact i totally forgot where to start!

Question: 
1. how shall i proceed to start coding for 2, 3, 4 project? do i need to install nodejs for every project after I fire up my machine every time?  

please advise..

thx

Ryan Schmidt

unread,
Jul 1, 2014, 11:38:12 PM7/1/14
to nod...@googlegroups.com
You only need the one copy of the nodejs and mongodb software, regardless of how many different node scripts or mongo databases you want to create.

To create a new node project, you would typically create a new directory named after your project, and in that directory, run the command "npm init", which will interactively walk you through setting up some initial aspects of your package.json file. Later, you can edit the package.json file in your editor as needed. Create new js files in your editor as needed to implement your code. Use "npm install ... --save" to install dependencies that you use and to record them in the package.json as well. Assuming you've set up the package.json file to do this, you would then run your code by running "npm start".

Reply all
Reply to author
Forward
0 new messages