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

yarn-offline-mirror scoped packages regression 1.3.2 --> 1.5.1 #5634

Open
majodev opened this issue Apr 10, 2018 · 8 comments
Open

yarn-offline-mirror scoped packages regression 1.3.2 --> 1.5.1 #5634

majodev opened this issue Apr 10, 2018 · 8 comments
Assignees
Labels

Comments

@majodev
Copy link

majodev commented Apr 10, 2018

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

It seems like scoped packages (e.g. @types/*) are no longer cached with a right/previous file identifier. For example@types/[email protected] resolves to a tar fs-extra-4.0.1.tgz while previously this lead to a file named @types%2ffs-extra-fs-extra-4.0.1.tgz.

If we try to reuse these cached yarn_packages in a Docker build in offline mode (yarn --pure-lockfile --offline) while our private registry is really not reachable we will fail with an error:

error An unexpected error occurred: "Can't make a request in offline mode (\"https://<PRIVATE-REGISTRY>/@types%2ffs-extra/-/fs-extra-4.0.1.tgz\")"

If the current behavior is a bug, please provide the steps to reproduce.

# on your host
yarn config set yarn-offline-mirror /<YOUR_PATH>
yarn --pure-lockfile

# Reuse this cache in a Dockerfile...
RUN npm install -g yarn

# Install dependencies and build project (automatically as part of the prepublish package.json hook)
RUN yarn config set yarn-offline-mirror /<YOUR_PATH> && yarn --pure-lockfile --offline --verbose

What is the expected behavior?

[email protected] should properly cache scoped packages (or pick them up again).

Please mention your node.js, yarn and operating system version.

yarn 1.3.2 and yarn 1.5.1
node.js LTS 8.11.1
CentOS 7 local / node:8 Docker base image

@ghost ghost assigned torifat Apr 10, 2018
@ghost ghost added the triaged label Apr 10, 2018
@bb1
Copy link

bb1 commented Apr 8, 2019

Related: #7011

@KevinGrandon
Copy link

We are still seeing this with yarn 1.16, resulting in an occasional broken offline-mirror setup. Any plans to look at this soon?

@arcanis - Not sure if you're aware of this or could provide some context for a possible pull request?

@arcanis
Copy link
Member

arcanis commented Jun 11, 2019

We are still seeing this with yarn 1.16, resulting in an occasional broken offline-mirror setup. Any plans to look at this soon?

I'm mostly focused on the v2, but can take a look at a diff.

@KevinGrandon
Copy link

I could be wrong, but my hunch is that this was broken in: #4822

@sandinmyjoints
Copy link

Also still seeing this

@KevinGrandon
Copy link

Also still seeing this

Question - are you using a custom registry by chance? Something I discovered is that registries may define their own URL for the tarballs which might not match up with the regex in the yarn codebase. I think that the yarn codebase should not be so closely tied to the tarballs URL.

@sandinmyjoints
Copy link

Nope, just using regular npm.

@dbrockman
Copy link

I'm seeing this bug in yarn 1.17.3 when installing a scoped package with an alias as name.

Yarn installed the package without creating an offline-mirror tar file when I did this:

yarn add types_alias__swagger-schema-official@npm:@types/[email protected]

I reproduced this in a small test repo but got inconclusive results. In my test repo I didn't get any tar files for any scoped packages but that works fine in my real project...

This is what my .yarnrc file in the project looks like if it helps:

yarn-path ".yarn/releases/yarn-1.17.3.js"
yarn-offline-mirror ".yarn/offline-mirror"
yarn-offline-mirror-pruning true
--install.offline true
--install.check-files true
--install.frozen-lockfile true

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

No branches or pull requests

7 participants