NervJS / taro

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
https://docs.taro.zone/
Other
35.66k stars 4.8k forks source link

官方脚手架demo npm安装方式无法运行 #16670

Open jackieyyang opened 1 month ago

jackieyyang commented 1 month ago

相关平台

微信小程序

小程序基础库: 3.5.5 使用框架: Vue 3

复现步骤

1.安装taro4.0.6 2.新建Vue3 JavaScript Npm Vite Github vue3-NutUI 3.npm install安装依赖 依赖冲突报错

期望结果

npm和yarn都能正常运行demo

实际结果

yarn可以正常装包运行demo,npm装包依赖冲突无法运行

环境信息

Taro CLI 4.0.6 environment info:
    System:
      OS: macOS 15.0
      Shell: 3.2.57 - /bin/sh
    Binaries:
      Node: 22.9.0 - /usr/local/bin/node
      Yarn: 1.22.22 - /usr/local/bin/yarn
      npm: 10.9.0 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 4.0.6 => 4.0.6 
      @tarojs/components: 4.0.6 => 4.0.6 
      @tarojs/helper: 4.0.6 => 4.0.6 
      @tarojs/plugin-framework-vue3: 4.0.6 => 4.0.6 
      @tarojs/plugin-html: 4.0.6 => 4.0.6 
      @tarojs/plugin-platform-alipay: 4.0.6 => 4.0.6 
      @tarojs/plugin-platform-h5: 4.0.6 => 4.0.6 
      @tarojs/plugin-platform-jd: 4.0.6 => 4.0.6 
      @tarojs/plugin-platform-qq: 4.0.6 => 4.0.6 
      @tarojs/plugin-platform-swan: 4.0.6 => 4.0.6 
      @tarojs/plugin-platform-tt: 4.0.6 => 4.0.6 
      @tarojs/plugin-platform-weapp: 4.0.6 => 4.0.6 
      @tarojs/runtime: 4.0.6 => 4.0.6 
      @tarojs/shared: 4.0.6 => 4.0.6 
      @tarojs/taro: 4.0.6 => 4.0.6 
      @tarojs/vite-runner: 4.0.6 => 4.0.6 
      babel-preset-taro: 4.0.6 => 4.0.6 
      eslint-config-taro: 4.0.6 => 4.0.6 
k103hub commented 1 month ago

遇到同样问题

mf-Peace commented 1 month ago

我也是一样的问题

skyclouds2001 commented 1 month ago

可以的话列下具体报错信息?

jackieyyang commented 1 month ago

通过taro init demo初始化项目,选择如下: 

Pasted Graphic

报错如下,@tarojs/plugin-framework-vue3需要 @vitejs/plugin-vue 的5.x版本。

npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: @tarojs/plugin-framework-vue3@4.0.6
npm error Found: @vitejs/plugin-vue@4.6.2
npm error node_modules/@vitejs/plugin-vue
npm error   dev @vitejs/plugin-vue@"^4.0.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peerOptional @vitejs/plugin-vue@"^5" from @tarojs/plugin-framework-vue3@4.0.6
npm error node_modules/@tarojs/plugin-framework-vue3
npm error   @tarojs/plugin-framework-vue3@"4.0.6" from the root project
npm error
npm error Conflicting peer dependency: @vitejs/plugin-vue@5.1.4
npm error node_modules/@vitejs/plugin-vue
npm error   peerOptional @vitejs/plugin-vue@"^5" from @tarojs/plugin-framework-vue3@4.0.6
npm error   node_modules/@tarojs/plugin-framework-vue3
npm error     @tarojs/plugin-framework-vue3@"4.0.6" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.

尝试升级 @vitejs/plugin-vue 5.x, 报错vite版本与 @vitejs/plugin-vue 5.x冲突。

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: demo@1.0.0
npm error Found: vite@4.5.5
npm error node_modules/vite
npm error   dev vite@"^4.2.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer vite@"^5.0.0" from @vitejs/plugin-vue@5.1.4
npm error node_modules/@vitejs/plugin-vue
npm error   dev @vitejs/plugin-vue@"^5" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.

找到了以前的相同问题,issue #16303,3个月前的bug了。

yangyingbiao commented 3 weeks ago

心真累啊,我也跑不起来,,vue3 + ts + nutui + vite,,已放弃了

k103hub commented 3 weeks ago

是的,感觉官方不太上心了,连官方脚手架项目都运行不起来,处理的奇慢无比

y3342113181 commented 2 weeks ago

一样,服了,最基础的初始化项目都不行