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

issues when publishing a module on remote npm and not being able to see it from local-npm #154

Open
gabrielcsapo opened this issue Jun 28, 2017 · 0 comments

Comments

@gabrielcsapo
Copy link
Member

gabrielcsapo commented Jun 28, 2017

Detailed Description

When a module is published in the remote npm repository and you try to install that version you will get

npm ERR! code ETARGET
npm ERR! notarget No matching version found for tap-html@0.0.4
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/gabrielcsapo/.npm/_logs/2017-06-28T04_26_07_277Z-debug.log

Possible Implementation

A possible solution is when installing a module local-npm, if it has that module cached, can go and retrieve a document from the remote npm and cache the new one. (this should be discussed further because this will cause issues with the speed of which local-npm will operate if it must constantly update from the remote)

Update

when installing a module it is possible to get the wanted module from the header

{
    "connection": "keep-alive",
    "user-agent": "npm/5.0.3 node/v6.9.4 darwin x64",
    "npm-in-ci": "false",
    "npm-scope": "",
    "referer": "install tap-html@0.0.4",
    "pacote-req-type": "packument",
    "pacote-pkg-id": "registry:manifest",
    "accept": "application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*",
    "accept-encoding": "gzip,deflate",
    "host": "127.0.0.1:5080"
}

so using the referrer instead of sending back the document right away, be sure to check if the version requested is in the cache.

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

No branches or pull requests

1 participant