jeudi 2 avril 2015

local node module does not get updated with npm link

My structure looks like this



Project name
- MYLOCALNODEMODULE
-- index.js
-- package.json

- node_modules (the common node modules i'm using, some examples below)
-- debug
-- express
-- mocha
-- MYLOCALNODEMODULE

- package.json (this is the common package.json)


What I tried doing was to create a directory where I will put my common code and I have that in index.js. Then from the top level, I did


npm link MYLOCALNODEMODULE


This worked and I was able to do



var local = require("MYLOCALNODEMODULE");
local.someFunction();


however now when I update the index.js file, in my other .js files I try to refer to that new code, it doesn't get updated. I tried uninstalling my local module and doing the npm link command again, but somehow it still doesn't get updated. Am I doing something wrong here? Thanks in advance.


Aucun commentaire:

Enregistrer un commentaire