"files" property in package.json ignores directories #2075

Closed
jbeard4 opened this Issue Jan 22, 2012 · 2 comments

Projects

None yet

2 participants

@jbeard4

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

@isaacs
npm member

Can you try with npm 1.1.13 and see if this problem still exists? Thanks.

@isaacs isaacs closed this Mar 27, 2012
@isaacs isaacs reopened this Mar 27, 2012
@isaacs
npm member

Oh, actually, yeah, it's still a bug.

@isaacs isaacs added a commit to npm/fstream-npm that referenced this issue Mar 27, 2012
@isaacs isaacs npm/npm#2075 Include the contents of dirs in 'files' array a391ba8
@isaacs isaacs added a commit that closed this issue Mar 27, 2012
@isaacs isaacs Fix #2075 Upgrade fstream-npm 331d498
@isaacs isaacs closed this in 331d498 Mar 27, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment