{"id":2152,"date":"2023-04-02T13:25:06","date_gmt":"2023-04-02T05:25:06","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=2152"},"modified":"2023-04-05T19:45:55","modified_gmt":"2023-04-05T11:45:55","slug":"vue-or-react-project-with-same-codes-running-error","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/04\/02\/vue-or-react-project-with-same-codes-running-error\/","title":{"rendered":"Vue\u6216React\u9879\u76ee\u4ee3\u7801\u76f8\u540c\u8fd0\u884c\u51fa\u9519\u91c7\u5751\u8bb0\u5f55"},"content":{"rendered":"<p>\u73b0\u8c61\uff1a\u540c\u4e00\u4e2a\u9879\u76ee\uff0c\u540c\u4e00\u5957\u4ee3\u7801\uff0c\u5728\u522b\u4eba\u7684\u673a\u5668\u4e0a\u6b63\u5e38\u8fd0\u884c\uff0c\u5728\u81ea\u5df1\u7684\u673a\u5668\u4e0a\u8fd0\u884c\u62a5\u9519<br \/>\n\u539f\u56e0\uff1a\u4f9d\u8d56\u95ee\u9898\uff0c\u5982\u679c\u672c\u5730\u6ca1\u6709<code>package-lock.json<\/code>\u6216<code>yarn.lock<\/code>\uff0c<code>package-lock.json<\/code>\u4e2d\u7684<code>^<\/code>\u4f1a\u5b89\u88c5\u5bf9\u5e94\u7684\u6700\u65b0\u7248\u672c\uff0c\u4f9d\u8d56\u7248\u672c\u4e0d\u4e00\u81f4\u5bfc\u81f4\u8fd0\u884c\u4e0d\u4e00\u81f4\uff08\u53c2\u6570\u4e0d\u4e00\u81f4\u3001\u9ed8\u8ba4\u503c\u4e0d\u4e00\u81f4\u7b49\u7b49\uff09<\/p>\n<h2>package-lock.json \u6587\u4ef6\u7684\u4f5c\u7528<\/h2>\n<p><!-- more --><\/p>\n<p>\uff081\uff09\u540c\u4e00\u4e2a\u9879\u76ee\u7b2c\u4e00\u6b21<code>cnpm install<\/code>\u7684\u65f6\u5019\u8fd8\u53ef\u4ee5\u542f\u52a8\uff0c\u8fc7\u4e00\u6bb5\u65f6\u95f4\uff0c\u628a<code>node_modules<\/code>\u5220\u6389\uff0c\u91cd\u65b0<code>cnpm install<\/code>\uff0c\u53d1\u73b0\u9879\u76ee\u542f\u52a8\u62a5\u9519\u4e86\u3002\u5947\u602a\uff0c\u9879\u76ee\u4ee3\u7801\u548c\u4e4b\u524d\u4e00\u6837\uff0c\u4e00\u70b9\u90fd\u6ca1\u6539\u52a8\u3002\u67e5\u5176\u539f\u56e0\uff0c\u53d1\u73b0\u662f<code>package.json<\/code>\u6587\u4ef6\u7684\u4f9d\u8d56\u6a21\u5757\u7248\u672c\u53f7\u6ca1\u6709\u56fa\u5b9a<\/p>\n<p>\uff082\uff09<code>package.json<\/code><\/p>\n<pre><code class=\"language-json\">&quot;dependencies&quot;: {\n  &quot;@antv\/data-set&quot;: &quot;^0.10.1&quot;,\n  &quot;@babel\/runtime&quot;: &quot;^7.3.1&quot;,\n  &quot;@vue\/eslint-config-prettier&quot;: &quot;^4.0.1&quot;,\n  &quot;antd&quot;: &quot;^3.24.2&quot;,\n  &quot;antd-mobile&quot;: &quot;^2.3.1&quot;,\n  &quot;bignumber.js&quot;: &quot;^8.1.1&quot;,\n  &quot;bizcharts&quot;: &quot;^3.4.3&quot;,\n  &quot;bizcharts-plugin-slider&quot;: &quot;^2.1.1-beta.1&quot;,\n  &quot;classnames&quot;: &quot;^2.2.6&quot;,\n  &quot;crypto-js&quot;: &quot;^3.1.9-1&quot;,\n  &quot;dva&quot;: &quot;^2.4.1&quot;,\n  &quot;enquire-js&quot;: &quot;^0.2.1&quot;,\n  &quot;eslint-plugin-vue&quot;: &quot;^5.2.2&quot;,\n  &quot;fs&quot;: &quot;0.0.1-security&quot;,\n  &quot;gg-editor&quot;: &quot;^2.0.2&quot;,\n  &quot;hash.js&quot;: &quot;^1.1.7&quot;,\n  &quot;lodash&quot;: &quot;^4.17.11&quot;,\n  &quot;lodash-decorators&quot;: &quot;^6.0.1&quot;,\n  &quot;md5&quot;: &quot;^2.2.1&quot;,\n  &quot;md5-node&quot;: &quot;^1.0.1&quot;,\n  &quot;memoize-one&quot;: &quot;^5.0.0&quot;,\n  &quot;moment&quot;: &quot;^2.24.0&quot;,\n  &quot;numeral&quot;: &quot;^2.0.6&quot;,\n  &quot;nzh&quot;: &quot;^1.0.4&quot;,\n  &quot;omit.js&quot;: &quot;^1.0.0&quot;,\n  &quot;path-to-regexp&quot;: &quot;^3.0.0&quot;,\n  &quot;prop-types&quot;: &quot;^15.6.2&quot;,\n  &quot;qr-image&quot;: &quot;^3.2.0&quot;,\n  &quot;qs&quot;: &quot;^6.6.0&quot;,\n  &quot;rc-animate&quot;: &quot;^2.6.0&quot;,\n  &quot;react&quot;: &quot;^16.7.0&quot;,\n  &quot;react-container-query&quot;: &quot;^0.11.0&quot;,\n  &quot;react-copy-to-clipboard&quot;: &quot;^5.0.1&quot;,\n  &quot;react-document-title&quot;: &quot;^2.0.3&quot;,\n  &quot;react-dom&quot;: &quot;^16.11.0&quot;,\n  &quot;react-fittext&quot;: &quot;^1.0.0&quot;,\n  &quot;react-google-recaptcha&quot;: &quot;^1.0.5&quot;,\n  &quot;react-media&quot;: &quot;^1.9.2&quot;,\n  &quot;svgpath&quot;: &quot;^2.2.2&quot;,\n  &quot;umi&quot;: &quot;^2.4.4&quot;,\n  &quot;umi-plugin-react&quot;: &quot;^1.7.2&quot;\n},<\/code><\/pre>\n<p>\u8fd9\u91cc\u6709\u4e2a<code>^<\/code>\uff0c\u5b89\u88c5\u7684\u65f6\u5019\u4f1a\u5b89\u88c5\u5bf9\u5e94\u7684\u6700\u65b0\u7248\u672c\uff0c\u5982\u679c\u8fd9\u671f\u95f4\u8be5\u6a21\u5757\u6709\u66f4\u65b0\uff0c\u518d\u6b21\u5b89\u88c5\u7684\u65f6\u5019\u7248\u672c\u4e0d\u4e00\u6837\uff0c\u6240\u4ee5\u9879\u76ee\u62a5\u9519\u4e86\u3002<\/p>\n<p>\uff083\uff09\u89e3\u51b3\u529e\u6cd5<\/p>\n<p>\u901a\u8fc7npm5\u4e4b\u540e\u5b89\u88c5\u6587\u4ef6\u4e4b\u540e\u4f1a\u591a\u51fa\u4e00\u4e2a<code>package-lock.json<\/code>\u7684\u6587\u4ef6<\/p>\n<p>\uff084\uff09<code>package-lock.json<\/code>\u6587\u4ef6\u7684\u4f5c\u7528<\/p>\n<ul>\n<li>\u5b89\u88c5\u4e4b\u540e\u9501\u5b9a\u5305\u7684\u7248\u672c\uff0c\u624b\u52a8\u66f4\u6539<code>package.json<\/code>\u6587\u4ef6\u5b89\u88c5\u5c06\u4e0d\u4f1a\u66f4\u65b0\u5305\uff0c\u60f3\u8981\u66f4\u65b0\u53ea\u80fd\u4f7f\u7528<code>npm install xxx@1.0.0 --save<\/code>\u8fd9\u79cd\u65b9\u5f0f\u6765\u8fdb\u884c\u7248\u672c\u66f4\u65b0<code>package-lock.json<\/code>\u6587\u4ef6\u624d\u53ef\u4ee5<\/li>\n<li>\u52a0\u5feb\u4e86<code>npm install<\/code>\u7684\u901f\u5ea6\uff0c\u56e0\u4e3a<code>package-lock.json<\/code>\u6587\u4ef6\u4e2d\u5df2\u7ecf\u8bb0\u5f55\u4e86\u6574\u4e2a<code>node_modules<\/code>\u6587\u4ef6\u5939\u7684\u6811\u72b6\u7ed3\u6784\uff0c\u751a\u81f3\u8fde\u6a21\u5757\u7684\u4e0b\u8f7d\u5730\u5740\u90fd\u8bb0\u5f55\u4e86\uff0c\u518d\u91cd\u65b0\u5b89\u88c5\u7684\u65f6\u5019\u53ea\u9700\u8981\u76f4\u63a5\u4e0b\u8f7d\u6587\u4ef6\u5373\u53ef<\/li>\n<\/ul>\n<p>\uff085\uff09cnpm\u4e0d\u652f\u6301<code>package-lock.json<\/code><\/p>\n<ul>\n<li>\u4f7f\u7528<code>cnpm install<\/code>\u65f6\u5019\uff0c\u5e76\u4e0d\u4f1a\u751f\u6210<code>package-lock.json<\/code>\u6587\u4ef6<\/li>\n<li><code>cnpm install<\/code>\u7684\u65f6\u5019\uff0c\u5c31\u7b97\u9879\u76ee\u4e2d\u6709<code>package-lock.json<\/code>\u6587\u4ef6\uff0ccnpm\u4e5f\u4e0d\u4f1a\u8bc6\u522b\uff0c\u4ecd\u4f1a\u6839\u636e<code>package.json<\/code>\u6765\u5b89\u88c5\u3002\u6240\u4ee5\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u4e4b\u524d\u4f60\u7528<code>npm<\/code>\u5b89\u88c5\u4ea7\u751f\u4e86<code>package-lock.json<\/code>\uff0c\u540e\u9762\u7684\u4eba\u7528cnpm\u6765\u5b89\u88c5\uff0c\u53ef\u80fd\u4f1a\u8ddf\u4f60\u5b89\u88c5\u7684\u4f9d\u8d56\u5305\u4e0d\u4e00\u81f4\uff0c\u8fd9\u662f\u56e0\u4e3a<code>cnpm<\/code>\u4e0d\u53d7<code>package-lock.json<\/code>\u5f71\u54cd\uff0c\u53ea\u4f1a\u6839\u636e<code>package.json<\/code>\u8fdb\u884c\u4e0b\u8f7d<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u73b0\u8c61\uff1a\u540c\u4e00\u4e2a\u9879\u76ee\uff0c\u540c\u4e00\u5957\u4ee3\u7801\uff0c\u5728\u522b\u4eba\u7684\u673a\u5668\u4e0a\u6b63\u5e38\u8fd0\u884c\uff0c\u5728\u81ea\u5df1\u7684\u673a\u5668\u4e0a\u8fd0\u884c\u62a5\u9519 \u539f\u56e0\uff1a\u4f9d\u8d56\u95ee\u9898\uff0c\u5982\u679c\u672c\u5730\u6ca1\u6709pa [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36,35],"tags":[548,363],"class_list":["post-2152","post","type-post","status-publish","format-standard","hentry","category-react","category-vue","tag-react","tag-vue"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/2152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=2152"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/2152\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=2152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=2152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=2152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}