NervJS / taro-project-templates

Templates for `taro init`
81 stars 71 forks source link

taro-ui-vue/vuex模板初始化失败,生成的package.json文件格式错误,且无法满足eslint版本依赖 #93

Open maoxuner opened 1 year ago

maoxuner commented 1 year ago

软件版本

$ uname -a
Linux ideabook 6.1.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 24 Jan 2023 21:07:04 +0000 x86_64 GNU/Linux
$ node -v
v18.13.0
$ npm -v
8.19.3
$ npx @tarojs/cli                 
👽 Taro v3.5.11

复现操作

$ npx @tarojs/cli init taro-ui-vue # Vue,TS否,Sass,Webpack5,npm,Gitee,taro-ui-vue

部分日志如下,生成的package.json文件,eslint后多一个,造成json解析失败

✔ cd taro-ui-vue, 执行 git init
⚠ npm
⚠  ERR! code EJSONPARSE
npm ERR! path /tmp/taro-ui-vue/package.json
⚠ npm 
⚠ ERR! JSON.parse
⚠  Unexpected token "," (0x2C) in JSON at position 2107 while parsing near "...\"eslint\": \"^8.12.0\",,\n    \"css-loader\": ..."
npm ERR! JSON.parse Failed to parse JSON data.
⚠ npm ERR! JSON.parse Note: package.json must be actual JSON, not just JavaScript.
⚠ 执行安装项目依赖 npm install, 需要一会儿...
⚠ npm ERR! A complete log of this run can be found in:
npm ERR!     /home/nono/.npm/_logs/2023-01-29T06_47_48_179Z-debug-0.log
✖ 安装项目依赖失败,请自行重新安装!
Error: Command failed: npm install
npm ERR! code EJSONPARSE
npm ERR! path /tmp/taro-ui-vue/package.json
npm ERR! JSON.parse Unexpected token "," (0x2C) in JSON at position 2107 while parsing near "...\"eslint\": \"^8.12.0\",,\n    \"css-loader\": ..."
npm ERR! JSON.parse Failed to parse JSON data.
npm ERR! JSON.parse Note: package.json must be actual JSON, not just JavaScript.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/nono/.npm/_logs/2023-01-29T06_47_48_179Z-debug-0.log

    at ChildProcess.exithandler (node:child_process:419:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1091:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) {
  code: 1,
  killed: false,
  signal: null,
  cmd: 'npm install'
}

手动修复package.json文件格式,去除多余的,,依然不满足eslint版本要求

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: taro-ui-vue@1.0.0
npm ERR! Found: eslint@8.33.0
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^8.12.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^5.0.0 || ^6.0.0" from eslint-plugin-vue@6.2.2
npm ERR! node_modules/eslint-plugin-vue
npm ERR!   dev eslint-plugin-vue@"^6.x" 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 /home/nono/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/nono/.npm/_logs/2023-01-29T06_59_52_849Z-debug-0.log
yoyo837 commented 1 year ago

eslint-plugin-vue 可以先手动更新一下版本

maoxuner commented 1 year ago

eslint-plugin-vue 可以先手动更新一下版本

手动处理是可以。但taro几乎所有的vue模板都无法开箱即用,各种bug。taroui对vue的支持性也一言难尽。简直是在劝退想使用taro开发跨端app的vue开发者。

yoyo837 commented 1 year ago

多一个逗号的问题已经处理了, 依赖后续找时间再处理.

maoxuner commented 1 year ago

多一个逗号的问题已经处理了, 依赖后续找时间再处理.

谢谢。我暂时选用uni-app去开发了,后面有机会再试试taro