I’ve been wondering the same thing. From various research I’ve done it appears meteor does not support local node modules. If anyone has been able to get local node modules to work, please share the wealth? Or if Meteor could confirm the intent of not allowing local node modules. Please
Basically local modules don’t work b/c, there is a line in the build script that checks whether the package returns a result from the npm repository.
/meteor/tools/isobuild/meteor-npm.js which is part of the meteor build process has the following function
var installNpmModule = function (name, version, dir) { ... }
Within this function the buid runs a ‘npm install’ command based on a meteor copy of npm. This will return an error when the npm module returns a 404 from the public npm repo.
See
I’ve thought of forking meteor to override this behavior unfortunately maintaining a fork is a little too much overhead for me and the current plan is to meteor-ize the node module in question.
I figured it wasn’t possible. In my case, I was trying to debug the prerender-node npm module so on the authors suggestion, I cloned the function and overrode it, putting in a few logging messages to see what it was actually doing.
I haven’t touched this in a while but from what I recall you need to restart Meteor to get it reload any changes, since no directory watching on a URL. Don’t recall if I tried to do a straight path, but a file url definitely works.
For within the project / for direct imports, I’ve been copying the directory over on changes because of iirc a symlink issue. I think I avoided npm link because I didn’t want a global install. I’ll check it out for you if these don’t work when I have a chance.
Thanks @dr.dimitru for the like Will take this opportunity to ask you confirm if this still works? Because last time I tried it didn’t, but I didn’t look into it in depth.