答案1
在 -R 选项的 zip 手册页中,它说明了以下内容:
-R
--recurse-patterns
Travel the directory structure recursively starting at the current directory; for example:
zip -R foo "*.c"
In this case, all the files matching *.c in the tree starting at the current directory are stored into a zip archive named foo.zip. Note that *.c will
match file.c, a/file.c and a/b/.c. More than one pattern can be listed as separate arguments. Note for PKZIP users: the equivalent command is
因此它正在目录树中搜索index.js
, \"*.json\"
(老实说不确定它如何处理该模式或您试图用它完成什么)和node_modules
。但是,您尚未指定"*.js"
或类似的内容来包含其他 .js 文件。