npm install sqlite3
sqlite3 was installed in the home directory in a folder called "node_modules"
however my server dir is different and from there I am unable to link to sqlite3 unless I copy the "node_modules" folder into my server dir.
Is there a way to link the installed "sqlite3" so that its globally accessibly from any directory?
Thanks in advance.
Be in the root directory of your project when you run the "npm install sqlite3" command, so that it gets installed in the correct directory.
You are meant to install separate copies of things for each project. You're not meant to link things.
1. Is this a limitation of node modules or something to do with "sqlite3" ?
2. Why didn't they allow to install once and any or multiple projects to link to that module?
3. Instead of installing the module multiple times can it be installed once and then the "node_modules" folder be copied to the project dir?
~Ryan
There are ways of doing this, yes, but I'm curious what problem you are trying to solve by doing this.
~Ryan
Dependencies are loaded relative to the location of the code, not your current working directory. If you have code in foo/dir1/proc1.js and code in foo/dir2/proc2.js, they will both see modules in foo/node_modules regardless of which directory you run them from (eg. `cd /bar/dir3; node /foo/dir1/proc1.js`). Does that help?
~Ryan
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/fa1e0949-4926-4c8f-b33f-1bfdd326b3e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
~Ryan