Closed vladwing closed 8 years ago
First of all, we need to implement postinstall hooks. package.json
has 'scripts' section and we need to execute preinstall
, install
and postinstall
sections.
Then we need to implement default npm behavior. If package contains binding.gyp
file, npm assumes the following preinstall script if it is not defined. Proof on NPM docs
"scripts":{"preinstall": "node-gyp rebuild"}
Here we go and good luck.
The problem is right now there is no way we can reliably know when a package has been completely installed (meaning all its subdependencies have been downloaded and linked).
You say in the documentation that installs are atomic - I thought that's what you mean. When do you in fact move a package out of node_modules/.tmp
? And if you don't move it when you can link its dependencies in its own node_modules
, then when do you link them?
Yes, it's as atomic as it can be. Circular dependencies can't be ordered topologically, which we currently (more or less) do.
It seems right now
ied
doesn't support node.js addons (native modules). When the user installs packages that have C/C++ native code, for examplelibpq
, the installer just downloads the package and ignores thebindings.gyp
file which specifies how the package should be compiled.I assume supporting addons/native modules is is a planned feature, and if so I would like to contribute a PR. Can you point me in the right place to start?