node.js - Calling nodejs scripts from the command line does not work -


this file test.js contains:

console.log("hello stackoverflow"); 

this happens when attempt run it:

$ ls test.js $ node test.js $ node test $ node "test" $ node "test.js" $ node --debug test.js debugger listening on port 5858 $ node --debug test debugger listening on port 5858 $  

notice never works :( can run "node" , evaluate javascript statements line line whenever try run script above not work.

i'm running os x 10.8 , brand new installation of nodejs.

the solution problem uninstall node using:

sudo rm -rf /usr/local/{bin/{node,npm},lib/node_modules/npm,lib/node,share/man/*/node.*} 

i installed brew on mac:

ruby -e "$(curl -fssl https://raw.github.com/mxcl/homebrew/go)" 

and did

brew doctor 

i fixed issues told me fix that, , did

brew install node 

i restarted terminal, , node working.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -