简体   繁体   English

如果我没有使用 GitHub,npm 如何提交 package-lock.json

[英]npm how to commit package-lock.json if I did not use GitHub

I downloaded NodeJS and installed it on windows 10. I updated npm using the npm install npm@latest -g command line I neither used github nor anything else I get the message "created a lockfile as package-lock.json. You should commit this file".我下载了 NodeJS 并将其安装在 Windows 10 上。我使用 npm install npm@latest -g 命令行更新了 npm 我既没有使用 github 也没有使用其他任何东西,我收到消息“将锁文件创建为 package-lock.json。你应该提交这个文件”。

What should I do to commit the file?我应该怎么做才能提交文件? what happens when I commit it?当我提交时会发生什么? what happens if I don't commit it?如果我不提交会怎样?

Please do not quote the npm documentation, as I read it serveral times and did not undestand it.请不要引用 npm 文档,因为我已经阅读了好几次并且没有理解它。

Thanks谢谢

Thank you – jdubjdub & – SilverWolf - Reinstate Monica for your cogent remarks.谢谢– jdubjdub & – SilverWolf - Reinstate Monica的中肯言论。 Yours were the comments that led to my eventual comprehension;你的评论让我最终理解了; years after the fact for you, hours after the fact for me.对你来说事后多年,对我来说事后几小时。

I know this is an old post and the OP and OC's are likely to never see this answer;我知道这是一篇旧帖子,OP 和 OC 可能永远不会看到这个答案; I am dealing with this problem for the first time and have typed into the browser a reformulation of this very question many times today.我是第一次处理这个问题,今天已经多次在浏览器中输入了这个问题的重新表述。 I was near to trying the patience of some of the genuinely gifted people on Stack Overflow , attempting clarification for my own elementary version of the question.我几乎要在Stack Overflow尝试一些真正有天赋的人的耐心,试图澄清我自己的问题的基本版本。

I have finally come to recognise the term "commit" is not as alien as we thought.我终于意识到“提交”一词并不像我们想象的那么陌生。 It is what we thought it might have been.这就是我们认为可能的情况。 It's the same as on github as when we commit anything that we have changed and want other contributors (or authors) to see.这与在 github 上相同,当我们提交任何已更改的内容并希望其他贡献者(或作者)看到时。

I have a github account and git installed on my computer.我在我的电脑上安装了一个 github 帐户和 git。 After about an hour of docs and man pages I did not put all the dots together until I read the comments on this page and then it all finally just became so perfectly clear.经过大约一个小时的文档和手册页后,我没有把所有的点放在一起,直到我阅读了这个页面上的评论,然后一切终于变得如此清晰。 Commit is the same concept on github as is being referenced in my terminal: npm notice created a lockfile as package-lock.json. You should commit this file. Commit 与我的终端中引用的 github 概念相同: npm notice created a lockfile as package-lock.json. You should commit this file. npm notice created a lockfile as package-lock.json. You should commit this file. And since I am not actively working on a project I can disregard the warning.而且由于我没有积极参与一个项目,我可以无视警告。 Also, some argue the merit of ignoring it even if I were on production.此外,有些人认为即使我在制作中也忽略它的优点。 But that's beyond the scope of this post.但这超出了本文的范围。

Those whom only rarely use git or gitHub, have only the vaguest grasp on how one performs version control.那些很少使用 git 或 gitHub 的人,对如何执行版本控制只有最模糊的了解。 The term "commit", even when mentioned frequently in answer, does not necessarily obviate all but the one meaning or action.术语“提交”,即使在回答中经常提到,也不一定排除一种含义或动作以外的所有含义。

Our friends may not fully appreciate our incomprehension of the term "commit" in this context.在这种情况下,我们的朋友可能不会完全理解我们对“提交”一词的不理解。 We were thinking (in my naivete, at least I was) that there may be more than the one meaning to "commit" we are familiar with ie from github.我们在想(在我的天真中,至少我是)可能有不止一种我们熟悉的“提交”含义,即来自 github。

I guess these are just such a common abstract for anyone doing version control they assume since we've gotten this far we must grasp the nomenclature and are really puzzled by the deeper fundamental aspects of the underlying processes and procedures.我想这些对于任何进行版本控制的人来说只是一个常见的抽象,他们假设既然我们已经做到了这一点,我们必须掌握术语,并且对底层流程和程序的更深层次的基本方面感到非常困惑。

If you would like a more robust definition on exactly how (and why) to commit check this out: github: https://help.github.com/en/desktop/contributing-to-projects/committing-and-reviewing-changes-to-your-project .如果您想要一个关于如何(以及为什么)提交的更可靠的定义,请查看:github: https://help.github.com/en/desktop/contributing-to-projects/committing-and-reviewing-changes-to-your-project ://help.github.com/en/desktop/contributing-to-projects/committing-and-reviewing-changes https://help.github.com/en/desktop/contributing-to-projects/committing-and-reviewing-changes-to-your-project

I should note there are many free and paid version control tools available.我应该注意到有许多免费和付费的版本控制工具可用。 Here is not an exhaustive list containing 15: https://www.softwaretestinghelp.com/version-control-software/.这里不是包含 15 个的详尽列表: https://www.softwaretestinghelp.com/version-control-software/. : https://www.softwaretestinghelp.com/version-control-software/.

And here the github desktop app: https://desktop.github.com/.这里是 github 桌面应用程序: https://desktop.github.com/. : https://desktop.github.com/.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我是否提交由 npm 5 创建的 package-lock.json 文件? - Do I commit the package-lock.json file created by npm 5? 超出最大调用堆栈大小; 删除 node_modules 和 package-lock.json 并运行“npm i”无效 - Maximum call stack size exceeded; removing node_modules and package-lock.json and running 'npm i' did not work NPM:在package-lock.json中更改注册表 - NPM: change registry in package-lock.json npm pack 和缺少 package-lock.json - npm pack and missing package-lock.json 如何阻止 npm 在生产服务器上修改 package-lock.json - How can I stop npm from modifying package-lock.json on production server 如何npm更新package-lock.json中的依赖项版本? - How do I npm update dependency versions in the package-lock.json? GitHub 操作 NPM 错误:package-lock.json 文件是使用旧版本的 ZBB30E85411B56DF81296726AB445 创建的 - GitHub Actions NPM Error: package-lock.json file was created with an old version of npm 如何修复 package-lock.json 中未在 package.json 中列出的易受攻击的 npm 包? - How do I fix a vulnerable npm package in my package-lock.json that isn't listed in the package.json? 为什么“npm install”修改package-lock.json?为什么要把它交给git呢? - Why does “npm install” modify package-lock.json? Why commit it to git then? 我应该添加 npm-shrinkwrap.json、package-lock.json 还是 yarn.lock? - Should I add npm-shrinkwrap.json, package-lock.json or yarn.lock?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM