-
Notifications
You must be signed in to change notification settings - Fork 12k
yarn fails to handle angular-cli 1.2.4 dependencies correctly #7136
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
Comments
I had this problem this morning on windows, updating my node version to latest and the cli to 1.2.4 solved the issue, though |
Seems like this is definitely related to enhanced-resolve Builds that work do not have: /Users/jmurphy/projects/ubq/web/node_modules/@ngtools/webpack/node_modules/enhanced-resolve |
Weird - today im seeing the following on the failed builds
|
This does seem to be isolated to yarn. Running the following works: $ rm -rf node_modules Running the following fails: $ rm -rf node_modules The bug here is to make this work with yarn |
yarn resolves 2 versions of enhanced-resolve. - [email protected]:
- version "3.3.0"
- resolved "YARN_REGISTRY_OR_YOUR_PRIVATE"
- dependencies:
- graceful-fs "^4.1.2"
- memory-fs "^0.4.0"
- object-assign "^4.0.1"
- tapable "^0.2.5"
- enhanced-resolve@^3.3.0:
- version "3.4.1"
- resolved "YARN_REGISTRY_OR_YOUR_PRIVATE"
- dependencies:
- graceful-fs "^4.1.2"
- memory-fs "^0.4.0"
- object-assign "^4.0.1"
- tapable "^0.2.7"
+ [email protected], enhanced-resolve@^3.3.0:
+ version "3.3.0"
+ resolved "YARN_REGISTRY_OR_YOUR_PRIVATE"
+ dependencies:
+ graceful-fs "^4.1.2"
+ memory-fs "^0.4.0"
+ object-assign "^4.0.1"
+ tapable "^0.2.5" |
It looks like when ever I run yarn again the yarn.lock file gets rebuild. Is there a way to make this stick? |
@flauc did you try |
yarn only modifies yarn.lock if you add or upgrade a dependency. Running yarn does not change the yarn.lock - that is the point of having a lock file. So the fix only stops working if you upgrade @angular/cli or add webpack, etc. |
It looks like only doing this prevents the yarn.lock file from being recreated:
|
I was seeing the similar issues with enhanced-resolve yesterday with npm. It looks like the ^ dep on enhanced-resolve caused ngtools/webpack to change locally from [email protected] -> [email protected]. There must be a breaking change in enhanced-resolve somewhere. |
The lockfile changes for me too if I run |
@pschmoek @flauc @orestes Yarn can regenerate the lockfile on
I came to the same conclusion as @pschmoek regarding the workaround but you need to be mindful about how you modify the
It's important that you don't change the version in the second one when merging the two lines:
Yarn should not regenerate your lockfile after these modifications. Edit: just as an example: @pschmoek's diff uses |
Is this problem of yarn or of something? I am using yarn instead of npm because of better performance. But with npm, we get no problem in this case. I think this is not an issue of @angular CLI. Did we have to post an issue about this problem on yarn github? Or any other solutions here or come back npm? Please give your idea. Thanks. |
Hi guys! No problem for me in case of |
Hey all, As far as I can tell, this is indeed a problem with yarn, and as @pschmoek described: given two dependencies ( It's worth nothing that this only happens with newer versions of yarn. Older versions (like
If someone has an issue on the yarn tracker about this I'd love to have it linked here. Currently my stance is that this is indeed a I'll keep this issue opened to make it easier to direct people to it, but there is no action to take on the CLI. EDIT: @ryzy reports that even with |
@filipesilva There is a yarn issue about this, opened by @BorntraegerMarc yarnpkg/yarn#4024 |
Thanks @davidmehren and @BorntraegerMarc. I went through it and think there are some very good points there (reliance on hoisting and the absence of peer dependencies). I'm trying to figure out where that leaves us and what can be done on the short term. Will update as soon as I have news. |
We're trying to get a new fix released today (#7169), under |
The versions have been released. Please let me know if you still run into problems with yarn. |
Works for me. Big Thanks @filipesilva !!! |
Can confirm, 1.2.5 was broken, 1.2.6 works fine for me. |
|
Closing then, this seems to be sorted. |
@filipesilva I think you accidentally opened the issue again. It works like a charm for me now as well with yarn 0.27.5 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions.
@angular/cli: 1.2.4
node: 6.11.1
os: linux x64
@angular/common: 4.3.1
@angular/compiler: 4.3.1
@angular/core: 4.3.1
@angular/forms: 4.3.1
@angular/http: 4.3.1
@angular/platform-browser: 4.3.1
@angular/platform-browser-dynamic: 4.3.1
@angular/router: 4.3.1
@angular/cli: 1.2.4
@angular/compiler-cli: 4.3.1
Repro steps.
package.json
The log given by the failure.
Desired functionality.
When i run this on OS X it works fine.
Mention any other details that might be useful.
Yarn packages && node_modules deleted and reinstall on each linux build
The text was updated successfully, but these errors were encountered: