vue运行之神奇的npm install --legacy-peer-deps

网上找个例子,运行的时候各种冲突,各种报错,折腾了快一天都没跑起来。直到遇到了神奇的npm install --legacy-peer-deps 指令才成功。记录如下:

C:\workspace\vue2-happyfri>npm install
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: happyfri@1.0.2
npm ERR! Found: less@3.13.1
npm ERR! node_modules/less
npm ERR!   dev less@"^3.9.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer less@"^2.3.1" from less-loader@2.2.3
npm ERR! node_modules/less-loader
npm ERR!   dev less-loader@"^2.2.3" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Administrator\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Local\npm-cache\_logs\2022-08-26T08_32_12_224Z-debug-0.log

C:\workspace\vue2-happyfri>npm install --legacy-peer-deps
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN deprecated autoprefixer-loader@3.2.0: Please use postcss-loader instead of autoprefixer-loader
npm WARN deprecated babel-preset-es2015@6.24.1: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update!
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated chokidar@1.7.0: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated extract-text-webpack-plugin@1.0.1: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin
npm WARN deprecated html-webpack-plugin@2.30.1: out of support
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated svgo@0.7.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.

added 911 packages, and audited 912 packages in 1m

42 packages are looking for funding
  run `npm fund` for details

60 vulnerabilities (3 low, 43 moderate, 12 high, 2 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

C:\workspace\vue2-happyfri>npm run serve
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! Missing script: "serve"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Local\npm-cache\_logs\2022-08-26T08_35_27_312Z-debug-0.log

C:\workspace\vue2-happyfri>npm run dev
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

> happyfri@1.0.2 dev
> node build/dev-server.js

Listening at http://localhost:8088

webpack built 2f6e185a6aaba8bf329d in 2690ms
Hash: 2f6e185a6aaba8bf329d
Version: webpack 1.15.0
Time: 2690ms
                    Asset       Size  Chunks             Chunk Names
       static/img/1-2.png    21.3 kB          [emitted]
       static/img/1-4.png    2.09 kB          [emitted]
       static/img/2-1.png    4.95 kB          [emitted]
       static/img/2-2.png    2.16 kB          [emitted]
       static/img/3-1.png    2.46 kB          [emitted]
static/img/WechatIMG2.png    1.75 kB          [emitted]
       static/img/1-1.jpg     111 kB          [emitted]
       static/img/4-1.jpg     130 kB          [emitted]
       static/img/4-2.png    11.2 kB          [emitted]
       static/img/4-3.png    4.19 kB          [emitted]
       static/img/4-4.png    3.98 kB          [emitted]
       static/img/5-1.png  209 bytes          [emitted]
       static/img/5-2.png    6.24 kB          [emitted]
                   app.js    2.09 MB       0  [emitted]  app
                1.item.js    57.1 kB       1  [emitted]  item
                2.home.js    57.3 kB       2  [emitted]  home
               3.score.js      31 kB       3  [emitted]  score
               index.html  674 bytes          [emitted]
Child html-webpack-plugin for "index.html":
         Asset     Size  Chunks       Chunk Names
    index.html  1.48 MB       0
webpack: Compiled successfully.

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Vant是一个基于Vue.js的移动端组件库,而@vant/area-data是Vant提供的一个用于选择地区的数据组件。通过引入@vant/area-data并使用其中的areaList数据,可以实现城区选择的功能。 在引用中的代码示例中,我们可以看到在template中使用了van-area组件,并将area-list属性绑定为area,其中area是引入的areaList数据。这样就可以在页面上显示一个城区选择的组件。 在引用中的代码示例中,我们可以看到在Page中引入了@vant/area-data,并将其中的areaList数据绑定到页面的data中。这样就可以在页面中使用areaList的数据。 所以,vant/area-data是Vant组件库提供的用于选择地区的数据组件。<span class="em">1</span><span class="em">2</span> #### 引用[.reference_title] - *1* [vant框架引入省市区](https://blog.csdn.net/qq_38958284/article/details/119819980)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] - *2* [vant省市区引入@vant/area-data官方数据报错问题解决](https://blog.csdn.net/hy3528/article/details/131597399)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值