Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Halp! My package no longer installs properly... #1078

Closed
zdzolton opened this issue Jun 25, 2011 · 4 comments
Closed

Halp! My package no longer installs properly... #1078

zdzolton opened this issue Jun 25, 2011 · 4 comments

Comments

@zdzolton
Copy link

Hi,

After creating another server instance with the latest version of npm, my package coffee-resque-retry no longer seems to include all its files when installing.

For example, here I install the program locally:

foo $ npm install coffee-resque-retry
coffee-resque-retry@0.0.3 ./node_modules/coffee-resque-retry 
├── coffee-resque@0.1.4
└── redis@0.6.0
foo $ ls -l 
total 0
drwxr-xr-x  3 zach  staff  102 Jun 25 15:05 node_modules
foo $ ls -l node_modules/
total 0
drwxr-xr-x  11 zach  staff  374 Jun 25 15:05 coffee-resque-retry
foo $ ls -l node_modules/coffee-resque-retry/
total 32
-rw-r--r--  1 zach  staff  1475 Jun 25 15:05 LICENSE
-rw-r--r--  1 zach  staff   601 Jun 25 15:05 Makefile
-rw-r--r--  1 zach  staff  1177 Jun 25 15:05 README
drwxr-xr-x  4 zach  staff   136 Jun 25 15:05 lib
drwxr-xr-x  4 zach  staff   136 Jun 25 15:05 node_modules
-rw-r--r--  1 zach  staff   628 Jun 25 15:05 package.json
drwxr-xr-x  3 zach  staff   102 Jun 25 15:05 spec
drwxr-xr-x  4 zach  staff   136 Jun 25 15:05 src
foo $ npm -v
1.0.8

And, here is what happens when I install it on this server:

$ mkdir foo && cd foo
$ npm -v
1.0.14
$ npm install coffee-resque-retry
coffee-resque-retry@0.0.3 ./node_modules/coffee-resque-retry 
├── coffee-resque@0.1.4
└── redis@0.6.0
$ ls -l node_modules/
total 4
drwxr-xr-x 3 node root 4096 2011-06-25 20:09 coffee-resque-retry
$ ls -l node_modules/coffee-resque-retry/
total 8
drwxr-xr-x 4 root root 4096 2011-06-25 20:09 node_modules
-rw-r--r-- 1 node root  628 2011-06-25 20:09 package.json

Any ideas? I haven't changed anything in this project for a few weeks...

Please let me know if you have any other questions, or if you want me to try anything on my side!

Thanks,

Zach

@isaacs isaacs closed this as completed in 0844b25 Jun 25, 2011
@isaacs
Copy link
Contributor

isaacs commented Jun 25, 2011

The issue is in your "files": ["./lib"] line, which triggered a bug where npm's exclusion/inclusion logic would get tripped up by globs starting with !./. Since the "files" list is handled internally as a list of high-priority inclusion patterns (ie, ignore lines that start with an odd number of ! characters), this was causing the problem.

It worked previously because excludes weren't actually working properly for a few versions. We didn't notice, because very few packages will actually break if they contain too many files.

@zdzolton
Copy link
Author

Sorry, I didn't quite follow. How best should I articulate in my
package.json that I want all the files in the lib directory to be included?

Thanks,
Zach

On Sat, Jun 25, 2011 at 4:22 PM, isaacs <
reply@reply.github.com>wrote:

The issue is in your "files": ["./lib"] line, which triggered a bug where
npm's exclusion/inclusion logic would get tripped up by globs starting with
!./. Since the "files" list is handled internally as a list of
high-priority inclusion patterns (ie, ignore lines that start with an odd
number of ! characters), this was causing the problem.

It worked previously because excludes weren't actually working properly for
a few versions. We didn't notice, because very few packages will actually
break if they contain too many files.

Reply to this email directly or view it on GitHub:
https://github.com/isaacs/npm/issues/1078#issuecomment-1439247

@isaacs
Copy link
Contributor

isaacs commented Jun 26, 2011

What you're doing should be fine. There was a bug in the last few versions where "files":["./lib"] would fail, but "files":["lib"] would work fine. This is fixed in the latest npm release, so it should work fine if you upgrade.

@zdzolton
Copy link
Author

Okay, cool. I'll try again tonight or tomorrow.

On Sunday, June 26, 2011, isaacs
reply@reply.github.com
wrote:

What you're doing should be fine.  There was a bug in the last few versions where "files":["./lib"] would fail, but "files":["lib"] would work fine.  This is fixed in the latest npm release, so it should work fine if you upgrade.

Reply to this email directly or view it on GitHub:
https://github.com/isaacs/npm/issues/1078#issuecomment-1441919

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants