-
Notifications
You must be signed in to change notification settings - Fork 7.3k
[require()] installing from npm registry, requiring, uninstalling, then installing a different version then requiring again, attempts to execute the old main script #8266
Comments
I think that npm repo is a right place for this. Thanks for sharing, though. |
I couldn't re-open the bug but I'd like to add this. I highly suspect it's a node bug, with After further debugging, it seems all scripts paths are cached in |
that fixed it. or more like
|
I am not sure if that's a bug or works-as-designed anymore, but the Thanks. |
Hello. Will this issue be reopened since we now know that it comes from node? I've tried @akhoury workaround but it's not enough: the main script file is kept in cache in the packageMainCache property (which is not accessible from outside). So for example if I update winston from a 0.6.x version to 0.7.x version (where its dependency to Maybe we could at least expose the |
@sbellone good catch. could you write up a quick |
Sure, here it is: https://gist.github.com/sbellone/3947632a42be73553abb |
see my fork. I think I have a very ugly workaround. |
I think the best solution is to have all cacheKeys include full path and module exact versions in them, that needs to be changed in Node's core; Module. |
@indutny this issue end up being in node core. Could this issue be re-opened or at least investigated?
I suggest that the version (or the compressed package-url) should be included in the cache key |
Any updates about this issue, I stuck in here for 2 days long :( |
Yeah, pinging @indutny so he can re-evaluate whether closing was the right course of action here 😄 |
@julianduque may I ask you to reopen this issue at https://github.com/nodejs/node/issues ? |
@indutny not sure if you wanted to mention me but here is the new issue nodejs/node#4332 ;) |
node v0.10.3
,npm v1.4.4
even though
package.json
was clearly updated on the file system.If the old main script does not exists anymore the
require()
call fails, even if require's cache was cleared. I am not sure if that's an npm or nodejs bug.I've written a simple gist (if you would like to run it), of just checkout the logs output as a comment on the gist, and filed the same bug at the npm repo
https://gist.github.com/akhoury/c6104082c06749895535
thanks
The text was updated successfully, but these errors were encountered: