can't get phantom js hello world to work

I am looking to learn more about phantomjs.

  • installed sudo npm install -g phantomjs

  • installed phantom into my package.json (npm install phantom --save)

  • running phantom js

  • making sure to require phantom in my app.js ** also tried to create a hello.js file

    console.log('hello world');
    phantom.exit();
    

However, my command line shows 'cannot find module events'. When I ran the same syntax in hello.js my command line shows 'cannot open hello.js'.

Am i missing something very simple?

If you install any module globally , then according to this link you should link the global module using the npm link command

sudo npm link <MODULeNAME>