How I Work Around The require(“../../../../../../../”) Problem In NodeJS
41–44 of 44 posts
Re: How I Work Around The require(“../../../../../../../”) Problem In NodeJS
#42Re: How I Work Around The require(“../../../../../../../”) Problem In NodeJS
#43For me, a relative path in a require statement signifies that the required code is a part of the application itself. Consider: require('foo'); Versus: require('./foo'); If I find that a module is becoming popular, I may turn it into an npm module by moving it to it's own folder and adding a package.json, then using npm's bundledDependencies property to inform npm that it lives locally. (edit: Note that I've shifted m…
If find it's easier to distinguish modules from files by requiring modules like: require('foo'); and application files like: require('./foo.js'); //.js extension
Re: How I Work Around The require(“../../../../../../../”) Problem In NodeJS
#44Earlier quoted context omitted.
I don't think npm link is meant to be used in production like that.
You probably shouldn't be using npm for production builds. npm is good for libraries, but applications should probably be tarballed.