mapbox / npm-internal

helps you package internal npm modules and upload them to your own s3 bucket.
MIT License
11 stars 3 forks source link

Index.js file missing from published packages #20

Open alulsh opened 8 years ago

alulsh commented 8 years ago

Yesterday I used the latest version of npm-internal (https://github.com/mapbox/npm-internal/commit/d73792e1a8e30608f0b6290aba2919461e1c28a8) to publish a package.

I ran into a weird issue where my package would install but could not be required in another module.

Working with @ianshward, we noticed that the index.js file was missing from the published package, causing it to install successfully but fail on require(). This happened despite index.js being in the repo - it had been neither deleted nor modified as part of my commits for that package.

I was able to get around the issue by using https://github.com/mapbox/npm-internal/commit/5cb9c238e37d3edfa3b01771a6fbbb49715275da and re-publishing the package. The index.js file appeared in my package again. Now the package can be require successfully.

/cc @mapbox/devops

freenerd commented 8 years ago

Looks like the only change that happened between the two versions you used is https://github.com/mapbox/npm-internal/commit/d73792e1a8e30608f0b6290aba2919461e1c28a8 which changes the url on S3 and have no side-effects on included files when using the --dev flag.

@alulsh do you have a reproduceable test case? Could this be related to node/npm versions? Did you switch these between running the different npm-internal commits?

alulsh commented 8 years ago

@freenerd - last Friday I did experience the same missing index.js file issue with the https://github.com/mapbox/npm-internal/commit/5cb9c238e37d3edfa3b01771a6fbbb49715275da version of npm-internal. So it appears not to be related to the version of npm-internal. I do use nvm and frequently change between different Node versions so I agree with you this could be related to node/npm versions.

I haven't found a way to reproduce this - I can set aside some time to try with different versions of node and npm and determine which ones are affected.

freenerd commented 8 years ago

I can set aside some time to try with different versions of node and npm and determine which ones are affected.

This might not be worth investing effort if it's the result of some edge-case configuration mishap. I think if you find this problem again by accident, then it's worth capturing the state and try to reproduce.

sindresorhus commented 8 years ago

This is a known bug in npm, see: https://github.com/npm/npm/issues/5082

SamVerschueren commented 8 years ago

More info -> https://github.com/SamVerschueren/npm-publish-index-test