4 ms·
I think the idea is to NOT do that. If you're doing it in production, you probably run your node in user level anyway, so you should have node installed via nv
by catch23 15y ago
I think the idea is to NOT do that. If you're doing it in production, you probably run your node in user level anyway, so you should have node installed via nvm or similar tool.
Why would you want package.json to list native dependencies, shouldn't that be the responsibility of the npm package author? Usually npm packages that compile to native code will run 'make' on 'npm install'.
Another reason that you would NOT want this is because npm packages could potentially use older conflicting versions of the same library. NPM can manage this internally -- you wouldn't want rpm to install 2 different versions of the same package globally.
In the contrived example below, cluster & express are using 2 different versions of the 'log' npm package, but the main system using cluster & express have no clue that there are 2 different versions installed.
├─┬ cluster@0.6.9
│ └── log@1.2.0
├── ejs@0.4.3
└─┬ express@2.0.0
├── log@1.0.0
├── connect@1.1.0
└── qs@0.3.0