# npm-publish-index-test

> npm has an issue with adding `index.js` to the published package.

Latest version **0.3.0** (published 2016-04-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install npm-publish-index-test
pnpm add npm-publish-index-test
yarn add npm-publish-index-test
bun add npm-publish-index-test
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2016-04-27 |
| First published | 2016-04-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Sam Verschueren |
| Maintainers | samverschueren |

## Links

- npm: https://www.npmjs.com/package/npm-publish-index-test
- Repository: https://github.com/SamVerschueren/npm-publish-index-test
- Homepage: https://github.com/SamVerschueren/npm-publish-index-test#readme
- Issues: https://github.com/SamVerschueren/npm-publish-index-test/issues
- npm.io page: https://npm.io/package/npm-publish-index-test

## Dependencies (1)

- [noop3](https://npm.io/package/noop3.md) ^13.8.0

## Recent versions

- 0.3.0 (latest) — 2016-04-27
- 0.1.0 — 2016-04-27

## README

# npm-publish-index-test

> npm publish test repository

Issue: [npm#12498](https://github.com/npm/npm/issues/12498) → [npm#5082](https://github.com/npm/npm/issues/5082)<br>
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](https://github.com/sindresorhus) released his [array-differ](https://github.com/sindresorhus/array-differ) package after installing
Node 6 and suffered from the same bug.

In the following case, the bug always occurs.

- Add `index.js` to the [files](https://github.com/SamVerschueren/npm-publish-index-test/blob/v0.2.0/package.json#L15-L18) property in `package.json`
- Have `node_modules` directory with your dependencies
- Have a `.gitignore` file which ignores the `node_modules` directory


### Why

> The improved performance of `fs.realpath` has 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 pack
```

This 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

1. Downgrade `npm` to `npm@2` and republish your package!
2. Remove the `node_modules` directory first before publishing

I can't say 100% for sure that option 2 always works. You can always test with `npm pack` before publishing.

---
_Source: https://npm.io/package/npm-publish-index-test · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
