Skip to content
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

package-lock.json is required for npm ci #3359

Merged

Conversation

ibidani
Copy link
Contributor

@ibidani ibidani commented Dec 10, 2019

Description

react-reload example required package-lock.json when using "npm ci" build.
This change compliments #3333 which helped reduce build time.
Reference

The project must have an existing package-lock.json or npm-shrinkwrap.json
https://docs.npmjs.com/cli/ci.html

User facing changes
Before
When running "skaffold dev" under /examples/react-reload the following errors occurs and build fails:

Step 5/7 : COPY package* ./
 ---> Using cache
 ---> edbc34e38ab3
Step 6/7 : RUN npm ci
 ---> Running in 510a0e83fa54
npm ERR! cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or later to generate it, then try again.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-12-10T04_24_29_770Z-debug.log
FATA[0002] exiting dev mode because first build failed: build failed: build failed: building [react-reload]: build artifact: unable to stream build output: The command '/bin/sh -c npm ci' returned a non-zero code: 1 

After
Build succeeds

Step 5/7 : COPY package* ./
 ---> Using cache
 ---> 490edd60a29e
Step 6/7 : RUN npm ci
 ---> Using cache
 ---> 0c2e9fda78cf
Step 7/7 : COPY . .
 ---> 5f198885d82b
Successfully built 5f198885d82b
Successfully tagged react-reload:v1.0.0-142-gcf0a96c8-dirty
Tags used in deployment:
 - react-reload -> react-reload:5f198885d82b28cea904151e4458accb0dccc3c85ab363a02af155b87b1a95a0
   local images can't be referenced by digest. They are tagged and referenced by a unique ID instead
Starting deploy...
 - deployment.apps/node configured
Watching for changes...

Next PRs.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes unit tests
  • Mentions any output changes.
  • Adds documentation as needed: user docs, YAML reference, CLI reference.
  • Adds integration tests if needed.

Reviewer Notes

  • The code flow looks good.
  • Unit test added.
  • User facing changes look good.

Release Notes

Examples of user facing changes:
- Skaffold config changes like
  e.g. "Add buildArgs to `Kustomize` deployer skaffold config."
- Bug fixes
  e.g. "Improve skaffold init behavior when tags are used in manifests"
- Any changes in skaffold behavior
  e.g. "Artifact caching is turned on by default."

@codecov
Copy link

codecov bot commented Dec 10, 2019

Codecov Report

Merging #3359 into master will not change coverage.
The diff coverage is n/a.

@dgageot dgageot added the kokoro:run runs the kokoro jobs on a PR label Dec 10, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Dec 10, 2019
@dgageot dgageot merged commit 3f2a7ae into GoogleContainerTools:master Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants