isaacs/npm — Issue #2075: "files" property in package.json ignores directories
Author: jbeard4
Created: 2012-01-22 19:19:24+00:00
State: open

I'm running the following verisons of npm and node:

jacob@jacob-VirtualBox:~$ npm --version
1.1.0-beta-4
jacob@jacob-VirtualBox:~$ node --version
v0.6.6

Documentation states the following about the "files" property in package.json:

files
The "files" field is an array of files to include in your project. If you name a folder in the
array, then it will also include the files inside that folder. (Unless they would be ignored by
another rule.)

I have a npm package with the following structure:

foo/
package.json
thisisafile
thisisadirectory/
thisisafileinadirectory

package.json is the following:

{
"name": "foo",
"version" : "0.0.1",
"files" : [ "thisisadirectory","thisisafile" ]
}

When running "npm install ./foo", the installed "foo" package has the following directory structure:

foo/
package.json
thisisafile

Here's a link to this reduced test case: http://stuff.echo-flow.com/github/foo.tgz