npm-publish-index-test v0.3.0
npm-publish-index-test
npm publish test repository
Issue: npm#12498 → npm#5082 Status: Identified
Problem
When I upgraded to Node 6, it came shipped with npm@3.8.6. I released new versions from some packages and after using those packages, my index.js
file was not published. At first I thought that it only affected me, "I must have done something wrong!". But it appeared that
Sindre Sorhus released his array-differ package after installing
Node 6 and suffered from the same bug.
In the following case, the bug always occurs.
- Add
index.jsto the files property inpackage.json - Have
node_modulesdirectory with your dependencies - Have a
.gitignorefile which ignores thenode_modulesdirectory
Why
The improved performance of
fs.realpathhas changed the timing and order of operations enough that it greatly exacerbates the race condition.
So probably something goes wrong because Node 6 improved the performance of fs.realpath.
Test
Go to your module directory and run the following command
$ npm packThis will generate a tarball just like the one that will be published. So extract the contents and take a look if some files are missing.
Solution
You have two options
- Downgrade
npmtonpm@2and republish your package! - Remove the
node_modulesdirectory first before publishing
I can't say 100% for sure that option 2 always works. You can always test with npm pack before publishing.