viernes, 2 de enero de 2015

my nodejs tool can't use itself

So I have this nodejs application short-jsdoc for documenting JavaScript code. The strange thing is that If I want to use it in itself, this is, installing it in its own project, nodejs refuses to do so:
cd short-jsdoc
npm install short-jsdoc --save-dev
npm WARN install Refusing to install short-jsdoc as a dependency of itself
At first I was surprised and I still am because nodejs always install dependencies locally inside the project and so this situation could be managed easily, but on the other side, the user from irc.freenode.org#Node.js give me crucial tips:
1) Why would I want foo depend on foo since in foo I already have all the code of foo?
2) If you are publishing a npm module then you should expose a main .js file and you can always require that file using require('./') syntax. That will always work. Thanks !

No hay comentarios: