atom / git-utils

Git Node Module
http://atom.github.io/git-utils
MIT License
166 stars 59 forks source link

package-lock.json: Fix misformed URLs #105

Closed DeeDeeG closed 3 years ago

DeeDeeG commented 3 years ago
Requirements for Contributing a Bug Fix (from template, click to expand) * Fill out the template below. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion. * The pull request must only fix an existing bug. To contribute other changes, you must use a different template. You can see all templates at . * The pull request must update the test suite to demonstrate the changed functionality. For guidance, please see . * After you create the pull request, all status checks must be pass before a maintainer reviews your contribution. For more details, please see .

Identify the Bug

I get an error during npm install due to misformed URLs:

% npm install                 
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules/jasmine-focused/jasmine-node@git+https:/github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/[user]/.npm/_logs/2020-12-30T23_38_03_316Z-debug.log

Description of the Change

Update some URLs in package-lock.json that got recorded strangely at some point.

These invalid URLs have the package name prepended. But a valid URL in this case starts with the protocol (`git+https://`) not the package name (`jasmine-node`). ```diff - "jasmine-node": "jasmine-node@git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", + "jasmine-node": "git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", ``` _(Git history detective work: Looks like these URLs were unknowingly changed to this strange format in an unrelated PR: https://github.com/atom/git-utils/pull/97. For what it's worth, I saw this error before in the apm repo: https://github.com/atom/apm/pull/875#issuecomment-620958597 and used the same fix.)_

Alternate Designs

Just delete package-lock.json and run npm install to generate a totally fresh lockfile, as was done in https://github.com/atom/git-utils/pull/104.

Possible Drawbacks

None.

Verification Process

npm install succeeds now on my computer. CI should pass.

Release Notes

N/A

DeeDeeG commented 3 years ago

This fix is now included in https://github.com/atom/git-utils/pull/104.