{"id":125,"date":"2022-01-21T09:54:29","date_gmt":"2022-01-21T09:54:29","guid":{"rendered":"http:\/\/114.132.224.28\/?p=125"},"modified":"2022-01-21T09:54:29","modified_gmt":"2022-01-21T09:54:29","slug":"package-json%e7%9a%84%e4%b8%80%e4%ba%9b%e5%ad%97%e6%ae%b5%e8%af%b4%e6%98%8e","status":"publish","type":"post","link":"http:\/\/localhost\/2022\/01\/21\/package-json%e7%9a%84%e4%b8%80%e4%ba%9b%e5%ad%97%e6%ae%b5%e8%af%b4%e6%98%8e\/","title":{"rendered":"package.json\u7684\u4e00\u4e9b\u5b57\u6bb5\u8bf4\u660e"},"content":{"rendered":"\n
\u4e00\u4e9b\u53ef\u4ee5\u6267\u884c\u7684\u6587\u4ef6\uff0c\u5f53install\u8fd9\u4e2a\u5305\u7684\u65f6\u5019\uff0c\u8fd9\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u5c31\u53ef\u4ee5\u5728script\u4e0a\u4f7f\u7528\u4e86<\/p>\n\n\n\n
\u672c\u5730\u94fe\u63a5\uff1a [packageName]: file: ‘.\/..’<\/p>\n\n\n\n
npm link\u548cnpm install\u7684\u65f6\u5019\u4f1a\u88ab\u5b89\u88c5<\/p>\n\n\n\n
\u8868\u793a\u4f7f\u7528\u8fd9\u4e2a\u5305\u662f\u4f9d\u8d56\u4e8e\u54ea\u4e2a\u7248\u672c\u7684\u63d2\u4ef6<\/p>\n\n\n\n
e.g:<\/p>\n\n\n\n
node-resolve:<\/p>\n\n\n\n
\u00a0“peerDependencies”: {\u00a0 \u00a0 “rollup”: “^2.42.0”\u00a0 },<\/p>\n\n\n\n
\u5373\u8fd9\u4e2a\u7248\u672c\u7684node-resolve\u63d2\u4ef6\u8981\u5728rollup 2.42.0\u7248\u672c\u4ee5\u4e0a<\/p>\n\n\n\n
\u5bf9\u4e8e\u4f7f\u7528npm run package.tgz\u6709\u7528\uff0cbundledDependencies\u6570\u7ec4\u91cc\u9762\u7684\u5305\u90fd\u4f1a\u88abnpm pack\u65f6\u5305\u542b\u8fdb\u53bb\uff0c\u4f1a\u8fde\u7740node_modules\u4e00\u8d77\u6253\u8fdb\u53bb\uff0c\u5bf9\u4e8e\u6ca1\u6709\u7f51\u7edc\u7684\u65f6\u5019\u76f4\u63a5install package.tgz\u5c31\u53ef\u4ee5\u4e0d\u7528\u91cd\u65b0\u62c9\u5305\u4e86\u3002<\/p>\n\n\n\n
\u6709\u5728\u4ee3\u7801\u4e0a\u63a7\u5236\u5982\u679c\u5b89\u88c5\u4e0d\u4e86\u8fd9\u4e2a\u5305\u4e5f\u4e0d\u4f1a\u5f71\u54cd\u4ee3\u7801\u8fd0\u884c<\/p>\n\n\n\n
\u544a\u8bc9\u5e94\u8be5\u4f7f\u7528\u4ec0\u4e48node\/npm\u7248\u672c<\/p>\n\n\n\n
\u6709\u4e00\u4e9b\u5185\u7f6e\u94a9\u5b50\u4ee5pre\u5f00\u5934<\/p>\n\n\n\n