npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Issue: npmignore is not working as expected

Hi everyone,

Initially, I did a package in my library (let’s say my-library) with this .npmignore file:

.babelrc
.codeclimate.yml
.eslintignore
.eslintrc
.github
.nvmrc
.travis.yml
config_runtime
test
src
scripts
webpack.config.js

and also this .gitignore file:

.DS_Store
dist
node_modules
npm-debug.log
npm-debug.log.*
.nyc_output
coverage

In one of the branches of this project (let’s say my-branch) I have removed this .npmignore file. Nevertheless, when I am trying to add this project with this branch in another package.json of another project like this:

"my-library": "github.com/frankpolite/mylibrary#my-branch"

, node_modules/my-library continues ignoring the /src folder when I am doing npm install :frowning_face: I tried to clean the cache, change the package version of my-library, but it’s not still working :cry:

Do you know some effective way to “restart” or “refresh” the files that the npmignore file are ignored previously?

Thanks in advance.

Frank


You have to explicitly include "src" in the files section of your package.json: https://docs.npmjs.com/files/package.json#files


Yes, it worked! Thanks a lot!