{"id":478,"date":"2022-09-17T23:54:05","date_gmt":"2022-09-17T15:54:05","guid":{"rendered":"http:\/\/gjweb.top\/?p=478"},"modified":"2022-09-17T23:54:07","modified_gmt":"2022-09-17T15:54:07","slug":"npm-%e5%9f%ba%e6%9c%ac%e6%93%8d%e4%bd%9c","status":"publish","type":"post","link":"https:\/\/gjweb.top\/?p=478","title":{"rendered":"npm \u57fa\u672c\u64cd\u4f5c"},"content":{"rendered":"\n<p>\u8fd1\u671f\u4f7f\u7528 npm install \u4f9d\u8d56\u65f6\u603b\u662f\u62a5\u9519, \u53d1\u73b0\u6dd8\u5b9d\u5b98\u65b9\u66f4\u6362\u4e86\u6e90\u7684 CDN \u94fe\u63a5<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm config set registry http:\/\/registry.npmmirror.com \/\/ \u5207\u6362npm\u4e3a\u6700\u65b0\u6dd8\u5b9d\u955c\u50cf\nnpm config get registry \/\/\u67e5\u770b\u5f53\u524d\u6e90<\/code><\/pre>\n\n\n\n<p>\u5378\u8f7d\u6307\u5b9a\u5305\u6587\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm uninstall &lt;\u4f9d\u8d56\u5305\u540d\u79f0&gt;<\/code><\/pre>\n\n\n\n<p>\u5347\u7ea7\u6307\u5b9a\u5305\u6587\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install xxx@latest <\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u5f00\u53d1\u4f9d\u8d56-\u751f\u4ea7\u4f9d\u8d56\">\u5f00\u53d1\u4f9d\u8d56 &amp; \u751f\u4ea7\u4f9d\u8d56<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>npm install xxx &#8211;save \/\/ -S<ul><li>\u751f\u4ea7\u4f9d\u8d56<\/li><\/ul><\/li><li>npm install xxx &#8211;dev \/\/ -D<ul><li>\u5f00\u53d1\u4f9d\u8d56<\/li><\/ul><\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u5176\u4ed6\u547d\u4ee4\">\u5176\u4ed6\u547d\u4ee4<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>npm remove xxx \/\/ \u5220\u9664\u6307\u5b9a\u5305,\u540c\u65f6\u4e5f\u4f1a\u5220\u9664\u8be5\u5305\u5728package.json\u4e2d\u7684\u58f0\u660e<br>npm aduit fix \/\/ \u76d1\u6d4b\u9879\u76ee\u4f9d\u8d56\u4e2d\u7684\u800c\u4e00\u4e9b\u95ee\u9898,\u5e76\u4e14\u5c1d\u8bd5\u4fee\u590d<br>npm view xxx versions \/\/ \u67e5\u770b\u8fdc\u7a0bnpm\u4ed3\u5e93\u4e2d\u7684\u6240\u6709\u7248\u672c\u4fe1\u606f<br>npm view xxx xersion \/\/ \u67e5\u770b\u4ed3\u5e93\u4e2dxxx\u5305\u7684\u6700\u65b0\u7248\u672c<br>npm ls xxx \/\/ \u67e5\u770b\u6240\u5b89\u88c5\u7684xxx\u5305\u7684\u6240\u6709\u7248\u672c<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd1\u671f\u4f7f\u7528 npm install \u4f9d\u8d56\u65f6\u603b\u662f\u62a5\u9519, \u53d1\u73b0\u6dd8\u5b9d\u5b98\u65b9\u66f4\u6362\u4e86\u6e90\u7684 CDN \u94fe\u63a5 \u5378\u8f7d\u6307\u5b9a\u5305\u6587\u4ef6 \u5347\u7ea7 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55],"tags":[],"class_list":["post-478","post","type-post","status-publish","format-standard","hentry","category-npm"],"_links":{"self":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/478","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=478"}],"version-history":[{"count":1,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/478\/revisions"}],"predecessor-version":[{"id":479,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/478\/revisions\/479"}],"wp:attachment":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=478"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=478"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}