Closed Xu-Xihe closed 2 years ago
Why don't you put your package-lock.json
under Git control?
package-lock.json
from .gitignore
package-lock.json
file with npm install
on your local machinepackage-lock.json
and .gitignore
你为什么不把你的
package-lock.json
在 Git 控制之下?
- 删除
package-lock.json
自.gitignore
- 在本地机器上创建
package-lock.json
文件npm install
- Git的添加,提交和推变化
package-lock.json
和.gitignore
Yeah,I soon noticed it.But there still a problom that the Docsy-examples don't upload its package-lock.json
to the repo.
I have already solved this problem now,but a small suggestion: maybe mark out this to the 'README.md'.
If someone followed the tips from the Docsy,maybe they will upload the same .gitignore
.(someone like me don't know npm
very well)
I have opened https://github.com/google/docsy-example/pull/140
This pull-request will help other users. Thanks!
Notes for newbies of npm
,
I have closed https://github.com/google/docsy-example/pull/140. They seem to introduce the use of npm install
for newbies of npm
and put package-lock.json
out of Git control.
You can use npm install
on your CI workflow without doing so. But in that case, your workflow will take much more time than using npm ci
and there is no reproducibility. npm ci
is the best way on CI/CD pipelines. To make your project stable and deployment speed fast, use package-lock.json
and npm ci
. For more details about it, see the official documentation: npm ci | npm Docs.
Checklist
Describe the bug
I have fork the docsy-example site and just copy the template for it in th README.md file. I only changed the on: branches from main to master. But after I pushed,it doesn't work.The Github Actions has showed me a '×',but I dont now why.
Relevant links
Relevant log output
Run npm ci npm ci shell: /usr/bin/bash -e {0} 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! /home/runner/.npm/_logs/2021-10-19T14_53_22_563Z-debug.log Error: Process completed with exit code 1.
Additional context.
NO.