I am getting this instruction on the terminal "npm notice created a lockfile as package-lock.json. You should commit this file." after I tried solving the EAUDITNOLOCK error.
Please help me with an step by step resolution.
Thanks!
I am getting this instruction on the terminal "npm notice created a lockfile as package-lock.json. You should commit this file." after I tried solving the EAUDITNOLOCK error.
Please help me with an step by step resolution.
Thanks!
To tell git to track the file you would use git add package-lock.json
To then commit it to git commit -m "Adding package lock"
As with any npm based project in git you will want to make sure your .gitingore
file contains at the very minimum the following
# Don't commit npm node_module directory
node_modules
If you don't have a .gitignore
file, then you will want to create one. For more information on gitignore please see the docs
The pacakge-lock.json
itself has benefit described in the npm documentation while boils down to specifically locking your dependencies to exact versions given that your pacakge.json
can define version ranges. This helps with debugging and keeping things stable overtime. Committing this file mean that you can always go to previous commit and have your environment setup exactly as it was and others can have your identical environment when they checkout your git repo.