Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm pack and missing package-lock.json

Tags:

node.js

npm

from npm documentation:

By default, the following paths and files are ignored, so there’s no need to add them to .npmignore explicitly:

.*.swp
._*
.DS_Store
.git
.hg
.npmrc
.lock-wscript
.svn
.wafpickle-*
config.gypi
CVS
npm-debug.log

Additionally, everything in node_modules is ignored, except for bundled dependencies. npm automatically handles this for you, so don’t bother adding node_modules to .npmignore.

when npm pack is executed, package-lock.json is not included in the archive.

is it a bug or is it expected and undocumented behavior?

like image 576
Mr. Avatar asked Oct 20 '25 18:10

Mr.


1 Answers

from package-lock.json docs:

One key detail about package-lock.json is that it cannot be published, and it will be ignored if found in any place other than the toplevel package.

like image 78
Mr. Avatar answered Oct 22 '25 09:10

Mr.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!