node.js - Have to run sudo npm install -g everytime -


i getting started on command line application node, have noticed every time make change index.js file have run "sudo npm install -g" relfect change. example

index.js

#!/usr/bin/env node console.log("hello"); 

under package.json

"bin": {     "movie": "index.js"   }, 

if run "movie" terminal prints out "hello".

now if change print statement under index.js console.log("world") , run "movie" terminal prints outs "hello" rather "world". if "sudo npm install -g" , run "movie" command, picks "world".

i not sure why happening?

use npm link instead of npm install. create symlink on directory can use testing if intalled locally on directory.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -