-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Fix isInLink tracking and improve recording of transitive deps file: in locks #40
Conversation
lib/shrinkwrap.js
Outdated
@@ -110,11 +110,13 @@ function shrinkwrapDeps (deps, top, tree, seen) { | |||
var childIsOnlyDev = isOnlyDev(child) | |||
var pkginfo = deps[moduleName(child)] = {} | |||
var requested = getRequested(child) || child.package._requested || {} | |||
var linked = child.isLink || child.isInLInk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var linked = child.isLink || child.isInLInk
child.isInLink
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
child.isLink
= "This module is a symlink in your node_modules
child.isInLink
= "Some parent module of this module is a symlink"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be a typo with a capital i in Link in isInLink.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good catch, thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was @christoffer-dropbox who caught it, I just wanted to clarify what I thought he meant.
512c1d5
to
f8396dd
Compare
Is this going to merged? This seems to be required for |
With this fix, it is possible to install local packages with dependencies. However, a package-lock.json is not created and an existing one has no effect for those dependencies: |
How can I help get this PR merged ? |
I would also like to help get this merged. Should I just look at why it's failing CI? |
@zkat What do we need to do to get this PR in the next npm release. We are having to run npm 5.6.0 with node 10 till this is fixed as you can't use |
FYI, I rebased this branch on latest and ran it locally it does fix the issue and I didn't have any other issues with it. Will run it on my local for awhile to see how well it does on my other projects as well. Not sure if that is what @zkat means by needs testing. I don't have access in Travis CI to re-run but @iarna there are a few issues with the tests. https://travis-ci.com/npm/cli/jobs/145118084 Maybe this breaks something else. |
I also can run npm test after rebasing on latest and get no failures for this branch. |
Adding some tests now for this issue. Maybe that is what they want. See PR #86 |
@iarna If you want to pull the test from my PR and merge or rebase this on latest I can close my PR. Not trying to take credit just trying to get this merged soon. |
I think this fix is not correct. Please see #40 (comment) above: |
@iarna -- Anything we can do to land this PR? |
Code from this PR was merged as part of another PR, #86. |
As @larsgw points out, this has actually been merged, so I'm gonna close this now. =D |
Thanks for this PR, @iarna: super, super useful. 👍 |
Still having this issue on |
Partially reverts npm#40/npm#86, keeping the "Don't record linked deps as bundled" part but reverting the "Don't iterate into linked deps" part. It seems that we need to record dependencies of linked deps in order for `npm ci` to work. Fixes https://npm.community/t/6-8-0-npm-ci-fails-with-local-dependency/5385 Fixes https://npm.community/t/npm-ci-fail-to-local-packages/6076
Partially reverts npm#40/npm#86, keeping the "Don't record linked deps as bundled" part but reverting the "Don't iterate into linked deps" part. It seems that we need to record dependencies of linked deps in order for `npm ci` to work. Fixes https://npm.community/t/6-8-0-npm-ci-fails-with-local-dependency/5385 Fixes https://npm.community/t/npm-ci-fail-to-local-packages/6076
Partially reverts #40/#86, keeping the "Don't record linked deps as bundled" part but reverting the "Don't iterate into linked deps" part. It seems that we need to record dependencies of linked deps in order for `npm ci` to work. Fix: https://npm.community/t/6-8-0-npm-ci-fails-with-local-dependency/5385 Fix: https://npm.community/t/npm-ci-fail-to-local-packages/6076 PR-URL: #216 Credit: @jfirebaugh Close: #216 Reviewed-by: @isaacs EDIT: Updated test to not rely on network and follow latest and greatest test patterns.
It's 2020 and I'm down this rabbit hole on 6.13.4 and I think I'm going to pull the trigger and switch to Yarn. |
Bumps [read-cmd-shim](https://github.com/npm/read-cmd-shim) from 2.0.0 to 3.0.0. - [Release notes](https://github.com/npm/read-cmd-shim/releases) - [Changelog](https://github.com/npm/read-cmd-shim/blob/main/CHANGELOG.md) - [Commits](npm/read-cmd-shim@v2.0.0...v3.0.0) --- updated-dependencies: - dependency-name: read-cmd-shim dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Also fixes: https://npm.community/t/issue-npm-install-with-local-packages-and-symlinks-enoent/518