Reputation: 2853
I am getting started on a command line application with node, i have noticed that every time i make a change to my index.js file i have to run "sudo npm install -g" to relfect the change. For example
index.js
#!/usr/bin/env node
console.log("Hello");
under my package.json
"bin": {
"movie": "index.js"
},
If i run "movie" from the terminal it prints out "Hello".
Now if i were to change the print statement under index.js to say console.log("World") and i run "movie" from the terminal it prints outs "Hello" rather than "World". But if i do "sudo npm install -g" and then run the "movie" command, it picks up "World".
I am not sure why this is happening?
Upvotes: 2
Views: 138