taro-project-templates
taro-project-templates copied to clipboard
taro-ui-vue/vuex模板初始化失败,生成的package.json文件格式错误,且无法满足eslint版本依赖
软件版本
$ 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
eslint-plugin-vue 可以先手动更新一下版本
eslint-plugin-vue 可以先手动更新一下版本
手动处理是可以。但taro几乎所有的vue模板都无法开箱即用,各种bug。taroui对vue的支持性也一言难尽。简直是在劝退想使用taro开发跨端app的vue开发者。
多一个逗号的问题已经处理了, 依赖后续找时间再处理.
多一个逗号的问题已经处理了, 依赖后续找时间再处理.
谢谢。我暂时选用uni-app去开发了,后面有机会再试试taro