Setting up node.js on Ubuntu 12.04 (with eclipse/nodeclipse/enide)

381 Views Asked by At

I'm trying to set up node.js on my Ubuntu 12.04 machine. I want to be able to use it through Eclipse but the process seems confusing.

So far what I have done.

  • Installed node.js. Shows v5.8.0 on running 'node -v'
  • Installed npm. Shows 3.7.3 on running 'npm -v'
  • Installed Express using 'npm install -g express'

  • Added this to my .bashrc file (I've installed node in ~/node)

    export PATH=$HOME/node/bin:$PATH
    export NODE_PATH=$HOME/node/lib/node_modules
    

I'm confused about what to do next. I installed Enide Studio 2015 through Eclipse Marketplace.

  • Switched to the Node perspective.
  • Created a new Node.js Express Project

But now I don't see the node project structure.

I also get a bunch of errors like: - Node.js executable can't be found

What am I doing wrong, or what have I not done?

Alternatively, I installed the linux version of enide from here: http://www.nodeclipse.org/

This contains an eclipse file, but on trying to open the eclipse file it says "there is no application installed for executable files". That's strange because my regular install of eclipse opens just fine. Also I'm running a 32 bit system so I've ensured the files are 32 bit, not 64 bit.

Please help!

2

There are 2 best solutions below

0
On BEST ANSWER

Ok figured it out. I had to set up the node.js path in Eclipse under Preferences>Nodeclipse.

2
On

if you have node and npm working do the following:

Install express generator:

sudo npm install express-generator -g

Read the documentation about the express generator at http://expressjs.com/en/starter/generator.html

Create an express application:

express myapp

Install dependencies:

cd myapp
npm install

Run the application:

npm start

or

node ./bin/www

Open you browser and navigate to http://localhost:3000