Getting error while running simple javascript using node framework

前端 未结 8 1999
闹比i
闹比i 2021-01-30 06:25

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

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

I\'m getting the following as a

8条回答
  •  一整个雨季
    2021-01-30 07:05

    If you are on ubuntu, follow:

    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 and not node!

提交回复
热议问题