Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
maoxuner opened this issue Jan 29, 2023 · 4 comments

Comments

@maoxuner
Copy link

软件版本

$ 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: [email protected]
npm ERR! Found: [email protected]
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 [email protected]
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
Copy link

yoyo837 commented Feb 17, 2023

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

@maoxuner
Copy link
Author

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

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

@yoyo837
Copy link

yoyo837 commented Feb 20, 2023

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

@maoxuner
Copy link
Author

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants