Skip to content
This repository has been archived by the owner. It is now read-only.

install-test: fix shrinkwrap handling of package-lock.json #20358

Merged
merged 1 commit into from Apr 20, 2018

Conversation

@raymondfeng
Copy link
Contributor

@raymondfeng raymondfeng commented Apr 17, 2018

For a simple project with .npmrc containing 'package-lock=false',
npm install-test command will generate package-lock.json.*.

If there is an existing package-lock.json, npm install-test triggers
lifecycle actions twice for both install and test.

The problem can be reproduced by the following package.json and npm it

package.json
{
  "name": "t",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo TEST"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "debug": "^3.1.0"
  }
}
For a simple project with .npmrc containing 'package-lock=false',
`npm install-test` command will generate package-lock.json.*.

If there is an existing package-lock.json, npm install-test triggers
lifecycle actions twice for both install and test.
@raymondfeng
Copy link
Contributor Author

@raymondfeng raymondfeng commented Apr 19, 2018

@zkat Any chance to review the PR? npm install-test is pretty much broken with package-lock ATM.

zkat
zkat approved these changes Apr 20, 2018
Copy link
Contributor

@zkat zkat left a comment

wow I'm the worst 4df5934

Thanks for this patch! haha

@zkat zkat changed the base branch from latest to release-next Apr 20, 2018
@zkat zkat merged commit 9d5d0a1 into npm:release-next Apr 20, 2018
1 check passed
@bajtos
Copy link
Contributor

@bajtos bajtos commented Apr 24, 2018

@zkat is it possible to back-port this change to the npm version line 5.6 that's shipped as part of Node.js 8.x LTS, please? How can I help to make this happen?

iarna added a commit that referenced this issue May 5, 2018
For a simple project with .npmrc containing 'package-lock=false',
`npm install-test` command will generate package-lock.json.*.

If there is an existing package-lock.json, npm install-test triggers
lifecycle actions twice for both install and test.

PR-URL: #20358
Credit: @raymondfeng
Reviewed-By: @zkat
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants