简体   繁体   English

在Ubuntu 12.04上设置node.js(使用eclipse / nodeclipse / enide)

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

I'm trying to set up node.js on my Ubuntu 12.04 machine. 我正在尝试在Ubuntu 12.04计算机上设置node.js。 I want to be able to use it through Eclipse but the process seems confusing. 我希望能够通过Eclipse使用它,但是过程似乎令人困惑。

So far what I have done. 到目前为止,我已经做了。

  • Installed node.js. 安装了node.js。 Shows v5.8.0 on running 'node -v' 在运行'node -v'时显示v5.8.0
  • Installed npm. 已安装npm。 Shows 3.7.3 on running 'npm -v' 在运行'npm -v'时显示3.7.3
  • Installed Express using 'npm install -g express' 使用'npm install -g express'安装Express

  • Added this to my .bashrc file (I've installed node in ~/node) 将此添加到我的.bashrc文件中(我已将node安装在〜/ 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. 我通过Eclipse Marketplace安装了Enide Studio 2015。

  • Switched to the Node perspective. 切换到“节点”透视图。
  • Created a new Node.js Express Project 创建一个新的Node.js Express项目

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 我还会遇到很多错误,例如:-找不到Node.js可执行文件

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/ 或者,我从此处安装了enide的linux版本: 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". 它包含一个eclipse文件,但是在尝试打开eclipse文件时会显示“没有为可执行文件安装应用程序”。 That's strange because my regular install of eclipse opens just fine. 这很奇怪,因为我的eclipse常规安装打开就好了。 Also I'm running a 32 bit system so I've ensured the files are 32 bit, not 64 bit. 另外,我正在运行32位系统,因此我确保文件是32位而不是64位。

Please help! 请帮忙!

if you have node and npm working do the following: 如果您有节点和npm工作,请执行以下操作:

Install express generator: 安装Express Generator:

sudo npm install express-generator -g

Read the documentation about the express generator at http://expressjs.com/en/starter/generator.html http://expressjs.com/en/starter/generator.html上阅读有关Express Generator的文档。

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 打开浏览器并导航到http://localhost:3000

Ok figured it out. 确定了。 I had to set up the node.js path in Eclipse under Preferences>Nodeclipse. 我必须在Eclipse中的Preferences> Nodeclipse下设置node.js路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM