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

Installation of Local Filesystem tgz Modules Fails in 0.23 #3168

Closed
kjbkjb opened this issue Apr 17, 2017 · 8 comments
Closed

Installation of Local Filesystem tgz Modules Fails in 0.23 #3168

kjbkjb opened this issue Apr 17, 2017 · 8 comments
Assignees

Comments

@kjbkjb
Copy link

kjbkjb commented Apr 17, 2017

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

What is the current behavior?
Version 0.23 breaks installation of local filesystem tgz files where 0.22 functioned as expected.

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

-"dependencies": {
"bell": "^8.6.0",
"local-package-on-fs": "file:.modules/local-package-on-fs-3.0.3.tgz",

The above excerpt from a package.json functions in 0.22 but fails in 0.23 as it attempts to find the package by the full name, including tgz on npm with the following error:

yarn
yarn install v0.23.2
[1/4] 🔍  Resolving packages...
error An unexpected error occurred: "https://npm-proxy.fury.io/.../.modules/local-package-on-fs-3.0.3.tgz: Request failed \"404 Not Found\"".
info If you think this is a bug, please open a bug report with the information provided in "/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

What is the expected behavior?

Yarn should respect file: references to .tgz files.

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

  • Node: 6.10
  • Yarn: 0.23
  • Mac OS: 10.12.4

I originally mentioned this issue on this pull request as it was dealing with files:
#2723

I can provide the full package.json or whatever other information you require.

@tibdex
Copy link

tibdex commented Apr 19, 2017

Hi, I stumbled on this issue too. Here is a script to reproduce it quickly:

YARN=yarn

rm -rf /tmp/yarntest
mkdir /tmp/yarntest
cd /tmp/yarntest

mkdir a
cd a
echo '{ "name": "a", "version": "1.0.0", "dependencies": { "b": "file:../b/b-v1.0.0.tgz" } }' > package.json

mkdir /tmp/yarntest/b
cd /tmp/yarntest/b
echo '{ "name": "b", "version": "1.0.0" }' > package.json
yarn pack

cd ../a

"$YARN" install

@bestander
Copy link
Member

Removed previous comment.
Reverting #2723 does not fix the issue

@bestander
Copy link
Member

The bug was introduced in #3004.
cc @arcanis, we'll need to fix it and add use case to tests

@bestander
Copy link
Member

@tibdex, thanks a lot for the repro steps, helped a lot.
There is a bug in a/package.json, I've modified it

@arcanis
Copy link
Member

arcanis commented Apr 21, 2017

The issue doesn't come from this commit. Apparently, when the code reaches this line, the tarball isn't available in the cache yet (but I've checked, and it is when the command complete! weird). Will investigate.

[edit] Wait, we shouldn't even enter this function, since the fetcher is supposed to be LocalTarballFetcher...

arcanis pushed a commit to arcanis/yarn that referenced this issue Apr 21, 2017
arcanis pushed a commit to arcanis/yarn that referenced this issue Apr 21, 2017
bestander pushed a commit that referenced this issue May 2, 2017
* Fixes #3168

* Adds tests

* Fixes linting
@aversini
Copy link

@bestander I see that you closed this issue but I can still reproduce it 100% of the time with the latest version of Yarn (0.25.2) by simply adding one step to the scenario above: yarn cache clean.
With a clean cache and no installed modules, every single time installing a local package tarball fails into a 404 error, trying to fetch it from the registry:

yarn add file:third/my-file.tgz
yarn add v0.25.2
[1/4] 🔍  Resolving packages...
error An unexpected error occurred: "http://registry.npmjs.org/third/myfile.tgz: Request failed \"404 Not Found\"".
info If you think this is a bug, please open a bug report with the information provided in "yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Any pointers? I can try to see if I can fix it and create a PR if you feel it's still a legit issue. Thanks!

@bestander
Copy link
Member

Does relative path work?

yarn add file:./third/my-file.tgz

@aversini
Copy link

Ah! It does work indeed!

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

No branches or pull requests

5 participants