Comments (6)
Sorry for my English first.
npm -A-> npm-register -B-> upstream(npm.org)
The issue happen at A.
you can compare same debug
package on two different registry:
china mirror: https://registry.npm.taobao.org/debug
original npm: https://registry.npmjs.org/debug
look at tarball
:
china mirror: "http://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz"
original npm: "https://registry.npmjs.org/debug/-/debug-0.1.0.tgz"
npm-register
's router is waiting for npm to request /debug/-/debug-0.1.0.tgz
.
But if the upstream is set to https://registry.npm.taobao.org/ , npm client will make request to "http://npm-register/debug/download/debug-3.1.0.tgz", then npm client got 404 error.
from npm-register.
I'm not following. What's the problem?
from npm-register.
tarballs router
r.get('/:scope?/:name/-/:scope2?/:filename/:sha', function * () {
This consider npm(cli) will try to download tarball from url looks like: /@types/node/-/@types/node-x.y.z/xxxxxxxxxx.tgz
But in fact, npm will download tarball from anywhere defined by package.versions['x.y.z'].dist.tarball
No documented rule about package.versions['x.y.z'].dist.tarball
, and some unofficial npm cdn will modify package json.
eg: http://registry.npm.taobao.org/@types%2Fnode
{
"versions": {
"0.0.1": {
"dist": {
"shasum": "d90a4d3bf1fe8f961edf0f76f34a7a6df79580be",
"size": 28040,
"noattachment": false,
tarball: "http://registry.npm.taobao.org/@types/node/download/@types/node-0.0.1.tgz"
},
}
}
}
the packages router will rewriteTarballURLs
this url to http://127.0.0.1:45678/@types/node/download/@types/node-0.0.1.tgz
Then npm will fail to download http://127.0.0.1:45678/@types/node/download/@types/node-0.0.1.tgz
with a 404.
from npm-register.
@GongT is this still an issue for you?
from npm-register.
I'm using sinopia now...
But looks like lib/routes/tarballs.js
is still using wrong path.
from npm-register.
Ok thanks. I think I understand this now, but could you clarify a little more? I believe this is only an issue if the package doesn't exist in npm-register and it gets passed through to npm with the wrong URL. What are the other use cases? Thanks!
from npm-register.
Related Issues (20)
- Heroku Button Deploy not working HOT 1
- Incompatible with node 10
- Docker hub image HOT 2
- Passing authorization details from env vars? HOT 2
- Permission denied when trying to create /data/tarballs
- Unsupported operation: `npm audit` HOT 1
- Unhandled rejection TypeError: Cannot read property '0.0.3' of undefined HOT 5
- heroku build fails because of "Outdated Yarn lockfile" HOT 3
- Circle CI Access Key for AWS causes Failed Integration HOT 6
- How to disable caching? HOT 6
- NPM Installing packages 404's HOT 1
- TypeError: Cannot promisify an API that has normal methods with 'Async'-suffix HOT 5
- Circle CI 2.0 Migration HOT 1
- Add Search to UI
- AWS > 2.304 Breaks Bluebird Promisify in NPM-Register HOT 4
- Support AWS SDK > 2.304 and Bluebird PromisifyAll
- Protect frontend ?
- Dockerfile is broken HOT 1
- Is this project maintained?
- Offering to add free integrity verification
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from npm-register.