{"id":20952,"date":"2026-08-28T14:54:37","date_gmt":"2026-08-28T06:54:37","guid":{"rendered":"https:\/\/blog.ywdevops.cn\/?p=20952"},"modified":"2026-08-28T14:55:03","modified_gmt":"2026-08-28T06:55:03","slug":"20952","status":"publish","type":"post","link":"https:\/\/blog.ywdevops.cn\/index.php\/2026\/08\/28\/20952\/","title":{"rendered":"npm ci \u548c npm install \u533a\u522b"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><code>npm ci<\/code> \u548c <code>npm install<\/code> \u6700\u5927\u533a\u522b\u662f\uff1a<strong><code>npm ci<\/code> \u7528\u6765\u5e72\u51c0\u3001\u7a33\u5b9a\u5730\u6309\u9501\u6587\u4ef6\u5b89\u88c5\uff1b<code>npm install<\/code> \u7528\u6765\u5f00\u53d1\u65f6\u65b0\u589e\/\u66f4\u65b0\u4f9d\u8d56\u3002<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u5bf9\u6bd4<\/th><th><code>npm ci<\/code><\/th><th><code>npm install<\/code><\/th><\/tr><\/thead><tbody><tr><td>\u4f7f\u7528\u573a\u666f<\/td><td>Jenkins\u3001CI\u3001\u90e8\u7f72\u3001\u62c9\u4ee3\u7801\u540e\u6784\u5efa<\/td><td>\u672c\u5730\u5f00\u53d1\u3001\u65b0\u589e\u4f9d\u8d56\u3001\u5347\u7ea7\u4f9d\u8d56<\/td><\/tr><tr><td>\u662f\u5426\u4f9d\u8d56 <code>package-lock.json<\/code><\/td><td>\u5fc5\u987b\u6709<\/td><td>\u53ef\u4ee5\u6ca1\u6709<\/td><\/tr><tr><td>\u662f\u5426\u4f1a\u4fee\u6539 <code>package-lock.json<\/code><\/td><td>\u4e0d\u4f1a<\/td><td>\u53ef\u80fd\u4f1a<\/td><\/tr><tr><td>\u662f\u5426\u4e25\u683c\u6309\u9501\u6587\u4ef6\u5b89\u88c5<\/td><td>\u662f<\/td><td>\u4e0d\u4e00\u5b9a<\/td><\/tr><tr><td><code>package.json<\/code> \u548c\u9501\u6587\u4ef6\u4e0d\u4e00\u81f4<\/td><td>\u76f4\u63a5\u5931\u8d25<\/td><td>\u4f1a\u5c1d\u8bd5\u66f4\u65b0\u9501\u6587\u4ef6<\/td><\/tr><tr><td>\u662f\u5426\u6e05\u7406 <code>node_modules<\/code><\/td><td>\u4f1a\u5148\u5220\u9664\u91cd\u88c5<\/td><td>\u4e0d\u4f1a\u81ea\u52a8\u5b8c\u6574\u6e05\u7406<\/td><\/tr><tr><td>\u901f\u5ea6<\/td><td>\u901a\u5e38\u66f4\u5feb\u3001\u66f4\u7a33\u5b9a<\/td><td>\u53ef\u80fd\u6162\u4e00\u4e9b<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u65e5\u5e38\u4f7f\u7528\u5efa\u8bae\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm ci --progress=false          #\u4e0d\u663e\u793a\u8fdb\u5ea6\u6761\r\nnpm run build<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6709\u65b0\u7684\u4f9d\u8d56\u5305\u9700\u8981\u66f4\u65b0\u7684\u65f6\u5019\uff0c\u4f7f\u7528install\uff0c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install \u65b0\u5305\u540d\r\nnpm install \u65b0\u5305\u540d --save-dev\r\nnpm install \u67d0\u5305@\u7248\u672c\r\nnpm uninstall \u67d0\u5305<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u53e5\u8bdd\u8bb0\uff1a<strong>\u6784\u5efa\u7528 <code>npm ci<\/code>\uff0c\u6539\u4f9d\u8d56\u7528 <code>npm install<\/code><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>npm ci \u548c npm install \u6700\u5927\u533a\u522b\u662f\uff1anpm ci \u7528\u6765\u5e72\u51c0\u3001\u7a33\u5b9a\u5730\u6309\u9501\u6587\u4ef6\u5b89\u88c5\uff1bnpm in [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":20953,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-20952","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":8}},"_links":{"self":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/20952","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/comments?post=20952"}],"version-history":[{"count":2,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/20952\/revisions"}],"predecessor-version":[{"id":20955,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/20952\/revisions\/20955"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media\/20953"}],"wp:attachment":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media?parent=20952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/categories?post=20952"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/tags?post=20952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}