0

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!

fractal5
  • 2,034
  • 4
  • 29
  • 50

2 Answers2

1

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

Pavel
  • 1,278
  • 2
  • 17
  • 34
  • I followed as you said, and was able to get the the express project working. Do you know how I can import this into the Eclipse environment now? – fractal5 Mar 17 '16 at 01:08
  • To answer my own question above, to import an already created project, set the default location the project folder when creating a new Express project. – fractal5 Mar 17 '16 at 01:36
0

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

fractal5
  • 2,034
  • 4
  • 29
  • 50