4

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".

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.

Thanks

Tarek EZZAT
  • 333
  • 1
  • 5
  • 15
  • 1
    if you're not doing any kind of version control (git), don't worry about it. the package-lock.json file is for making sure when you `npm install` in another environment, that you get the same version of all the packages you're using locally. – jdubjdub Dec 04 '17 at 21:50
  • 4
    Also, I'd like to point out that **git and GitHub are not the same thing!** You can use git locally without having GitHub involved at all; in fact, GitHub is a completely separate organization, basically just a _hosting provider_ for git repositories (with some other features). – SilverWolf Jun 04 '19 at 15:12

1 Answers1

2

Thank you – jdubjdub & – SilverWolf - Reinstate Monica for your cogent remarks. 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; 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.

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.

I have a github account and git installed on my computer. 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. 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. 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 i.e. from 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.

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/.

And here the github desktop app: https://desktop.github.com/.

zbozon
  • 25
  • 8