> Is there a way to determine, by inspecting the node_modules directory in some way or by running some npm command, what version of node built the modules therein, especially the binary modules?You might be able to see by running nm on the .node files, and seeing
some difference between 0.10 and 0.11, I haven't tried.
Indirectly, if you look at the package.json in deps, you can see an
_npmVersion, which might be considered to map to a particular node
version if you never change npm from that shipped. At least, from a
quick check I think that _npmVersion is for the installing npm, not
the publishing npm.
Indirectly, if you look at the package.json in deps, you can see an
_npmVersion, which might be considered to map to a particular node
version if you never change npm from that shipped. At least, from a
quick check I think that _npmVersion is for the installing npm, not
the publishing npm.
Unfortunately, both
_npmVersion
and _nodeVersion
(which recent versions of npm add to package metadata) are added at publish time, not install time. Aside from looking at the contents of native modules, there’s no way to tell which version of Node or npm was used to install a given node_modules
. :/
> there’s no way to tell which version of Node or npm was used to install a given node_modules. :/Ok, that's what I thought; thanks for confirming. This would be useful information for npm to store in the node_modules directory, so that it might be able to detect the situations where rebuilding modules is needed and suggest that to the user or even do so automatically.
A pull request or feature request on the npm issue tracker to that effect would be very helpful. ;) (I agree it's a good feature, but there's a huge backlog of good ideas awaiting implementation in npm.)
>> there’s no way to tell which version of Node or npm was used to install a given node_modules. :/
Oops, sorry for the misinformation, Ryan.
> Ok, that's what I thought; thanks for confirming. This would be useful information for npm to store in the node_modules directory, so that it might be able to detect the situations where rebuilding modules is needed and suggest that to the user or even do so automatically.
I would *love* an `npm rebuild -g`... but right now I've a find script that looks for .gyp files. Works OK. I know when I change node versions.
Oops, sorry for the misinformation, Ryan.
> Ok, that's what I thought; thanks for confirming. This would be useful information for npm to store in the node_modules directory, so that it might be able to detect the situations where rebuilding modules is needed and suggest that to the user or even do so automatically.
I would *love* an `npm rebuild -g`... but right now I've a find script that looks for .gyp files. Works OK. I know when I change node versions.
댓글 없음:
댓글 쓰기