Results 1 to 4 of 4

Thread: Node.js hello world

  1. #1
    Join Date
    Oct 2010
    Beans
    27

    Node.js hello world

    I'm on LXLE.

    I ran "sudo apt-get install node"
    And then made a helloworld.js file which contains "console.log("hello world");
    then I ran "node helloworld.js"

    but nothing happened. I thought the hello world program would be that simple. Am I missing something?

  2. #2
    Join Date
    Aug 2010
    Location
    Lancs, United Kingdom
    Beans
    1,588
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: Node.js hello world

    Quote Originally Posted by tumelo View Post
    I ran "sudo apt-get install node"
    Really? The package for node.js is called "nodejs". There is a package called "node" but that is an entirely different thing.

  3. #3
    Join Date
    Oct 2010
    Beans
    27

    Re: Node.js hello world

    I figured it out. Apparently the package is called nodejs, not node.

    So you have to run "sudo apt-get install nodejs"

    and then run the program with "nodejs helloworld.js" instead of "node helloworld.js"

  4. #4
    Join Date
    Oct 2010
    Beans
    27

    Re: Node.js hello world

    Sorry didn't read your response until after I figured it out and posted, but Thanks spjackson
    Last edited by tumelo; December 8th, 2015 at 07:30 PM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •