-
-
Save ardcore/1054298 to your computer and use it in GitHub Desktop.
pilkowski@dev:~$ npm ls | grep yui3 | |
└─┬ [email protected] | |
└── [email protected] | |
pilkowski@dev:~$ node -v | |
v0.4.8 | |
pilkowski@dev:~$ npm -v | |
1.0.13 | |
pilkowski@dev:~$ node | |
> var y = require('yui3') | |
> !!y | |
true | |
> y.YUI | |
Error: YUI3 Core package was not found; npm install yui3-core | |
at /home/pilkowski/node_modules/yui3/lib/node-yui3.js:299:15 | |
at /home/pilkowski/node_modules/yui3/lib/node-yui3.js:13:15 | |
at Object.YUI (/home/pilkowski/node_modules/yui3/lib/node-yui3.js:24:15) | |
at [object Context]:1:2 | |
at Interface.<anonymous> (repl.js:171:22) | |
at Interface.emit (events.js:64:17) | |
at Interface._onLine (readline.js:153:10) | |
at Interface._line (readline.js:408:8) | |
at Interface._ttyWrite (readline.js:585:14) | |
at ReadStream.<anonymous> (readline.js:73:12) | |
> |
npm install installs package for use in current project. if you do npm install foo in ~/projects/a and then try to use foo package in ~/projects/b you'll get error as it won't be visible.
npm install . all it does is installing dependencies (into ./node_modules) of project you're currently at. Dependencies are read from package.json file. In other words npm install . means - make project I'm at, ready for use.
According to your environment, it's quite understood that you want to share same node binary. I wonder how it should be resolved (?)
I can think now of two ways, one is to override setting for global path for modules (if it's possible, I'm just guessing), so it doesn't try to install globally packages where node lives but somewhere within your user path. Other way would be, is that you all agree with which node version you work and each of you have same version installed locally.
:)
I think the main difference is that we're not talking about my own machine, it's a dev server on which node is used by 5 users now (and 10 more potentially). It simply makes no sense to make them all install node locally.
by 'installing node globally' I meant 'make; sudo make install'. it does not cause node to run with root privileges, it simply copies/links binaries to /usr/local/bin and allows them to be used by anyone on the server. standard way of installing stuff for more than one user.
from what I understand, in my setup it works like this: