Error starting simple javascript using node framework

When I run this piece of code using node a.js :

 var sys = require('sys'); sys.puts('Hello, World'); 

I get the following as an error

 axconfig: port 1 not active axconfig: port 2 not active 
+68
javascript
Mar 11 '10 at 11:02
source share
8 answers

Warning: this is old, but it may still work.

You did not install node.js, but the node package (which contains some other unrelated software) for your linux distribution.

You can install node.js in three ways: using git, downloading the version file, or installing through the package manager, I recommend using the package manager for ease of use and the ability to easily upgrade.

Package manager

Check out Installing node.js through the package manager . It contains installation instructions using the package manager of your preferences.

Direct download

Go to the node.js download page and download the package for your OS. Remember that doing this this way does not automatically update node.js later!

Source Compilation / git

First you need git and a compiler, here is how you install them on debian / ubuntu (it depends on your package manager):

 sudo apt-get install git-core build-essential 

(If you do not want to use git, you can download the source code from the website. Your OS still needs the built-in or equivalent.)

Then go to the folder where the "node" repository will be placed, something like ~/projects or ~/src will be good enough, and do the following:

 git clone https://github.com/joyent/node.git 

Then enter the node directory, configure it and create.

 cd node && ./configure && make 

Everything should go well. Before installing node, you can run tests to check for any problems:

 make test 

Finally, you can install node, this allows you to run the node command anywhere in the system and javascript library to install.

 make install 

... and you're done. You can check these lines of code using node-repl (node REPL , think of an "interactive interpreter"), just type node-repl , close Ctrl + D.

+90
Mar 17 '10 at 12:55
source share

axconfig: port 1 is inactive axconfig: port 2 is inactive

this problem is not related to nodejs.

Do not install node using the sudo apt-get install node command, this will install the radio package (node). this radio package requires accents to be active, which is not related to nodejs

So remove node from sudo apt-get remove node

Manually Download nodejs from here or from GitHub , but make sure you install the stable branch (0.4.x) .Unpack the nodejs.

To install, follow the instructions README.md

After installation, set the environment variables echo PATH=$PATH:/home/user/pathtonode/

+34
May 30 '11 at 5:10
source share

you installed node, you need nodejs package

+11
Sep 20 '12 at 7:08
source share

If you are on ubuntu, follow these steps:

 sudo apt-get update sudo apt-get install python-software-properties sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update sudo apt-get install nodejs 

You need to install nodejs, not node!

+11
Jun 20 '13 at 18:36
source share

Brandon Helwig is true. It happened to me. In general, if you get this type of error, you have installed the wrong package. Below are additional instructions for installing one of the latest versions of Node.js.

Fix

 sudo apt-get remove node 

This will remove the accidentally installed package. Both package names node and nodejs same as node .

If you do sudo apt-get install node , then you will get the old version. But thanks to Chris Lee, we got a PPA for this task.

 sudo apt-get update sudo apt-get install python-software-properties sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update sudo apt-get install nodejs 

This should help you get the latest version of Node.js in your application.

If you need a short-edged version, you can install it from the source. But I think it is cleaner.

+6
Sep 16 '13 at 8:56
source share

This problem occurs in ubuntu, so I solved this problem with git. Clone this new source from github and follow these steps:

Then it will work well.

+1
Apr 23 '14 at 6:28
source share

If installing Node.js works for you, as suggested by ninja (e.g. on AWS Ubuntu):

 sudo apt-get update sudo apt-get install python-software-properties sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update sudo apt-get install nodejs 

you can still add node to your system path as follows:

 export PATH=/usr/bin/:$PATH 

so you can enter

 node webapp.js 

instead

 /usr/bin/node webapp.js 

Find the node installation path by simply typing

 which node 
0
Jul 19 '13 at 15:17
source share

The easiest way is to first remove the node installation and then install npm. npm is node package manager, this will automatically install nodejs itself

0
Oct 22 '13 at 6:38
source share



All Articles