Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Old packages won't install ('invalid filename' error) #75

Closed
josephg opened this issue May 14, 2014 · 3 comments · Fixed by #78
Closed

Old packages won't install ('invalid filename' error) #75

josephg opened this issue May 14, 2014 · 3 comments · Fixed by #78

Comments

@josephg
Copy link
Contributor

josephg commented May 14, 2014

Using master of sinopia:

Client:

$ npm install thirty-two --registry=http://localhost:4873/
npm http GET http://localhost:4873/thirty-two
npm http 200 http://localhost:4873/thirty-two
npm http GET http://localhost:4873/thirty-two/-/thirty-two@0.0.1.tgz
npm http 403 http://localhost:4873/thirty-two/-/thirty-two@0.0.1.tgz
npm ERR! fetch failed http://localhost:4873/thirty-two/-/thirty-two@0.0.1.tgz
npm ERR! Error: 403 Forbidden
...
npm ERR! npm -v 1.4.3

Server:

$ bin/sinopia 
 warn  --- Server is listening on http://localhost:4873/
 http  <-- 304, user: undefined, req: 'GET /thirty-two', bytes: 0/0
 http  <-- 403, user: undefined, req: 'GET /thirty-two/-/thirty-two@0.0.1.tgz', error: invalid filename
@josephg
Copy link
Contributor Author

josephg commented May 14, 2014

The problem is that thirty-two was published 3 years ago, and apparently npm used to have a different tarball naming system.

in utils.js's validate_name it checks for name.match(/[\/@\s\+%:]/), and the tarball file for thirty-two contains an @ - its thirty-two@0.0.1.tgz. Newer packages use a dash instead: livedb-mongo-0.3.2.tgz.

I'm happy to submit a PR to fix this - what would be the best way?

@josephg josephg changed the title Some packages won't install ('invalid filename' error) Old packages won't install ('invalid filename' error) May 14, 2014
@rlidwka
Copy link
Owner

rlidwka commented Jun 17, 2014

Thanks, should work now. Also, I've changed that regexp so names won't have arbitrary unicode in them (encodeURIComponent used to take care of that before).

(and sorry for answering late, was on vacation)

@josephg
Copy link
Contributor Author

josephg commented Jun 17, 2014

Its cool - I know how it goes. Thanks!

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

Successfully merging a pull request may close this issue.

2 participants