Skip to content
This repository has been archived by the owner on Aug 11, 2022. 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

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

Copy link
Contributor

@zkat zkat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow I'm the worst 4df5934

Thanks for this patch! haha

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

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 pushed a commit that referenced this pull request 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
Development

Successfully merging this pull request may close these issues.

None yet

3 participants