const ci = require('miniprogram-ci');
(async () => {
const project = new ci.Project({
appid: 'xxxx',
type: 'miniProgram',
projectPath: 'xxxx',
privateKeyPath: 'xxx',
ignores: ['node_modules/**/*'],
})
await ci.upload({
project,
version: '1.2.1',
desc: 'hello',
setting: {
es6: true,
},
onProgressUpdate: console.log,
})
})()
["tabBar"]["list"][0]["iconPath"]: "static/image/home.png" not found
去掉tabBar中的图片就不会报错,并且 在微信开发者工具中上传和预览都不会有这种问题
projectPath设置多了吗?
检查下文件路径是否对的,文件是否存在呢?
我用CI上传没问题。官方文档里的写法
{
"tabBar": {
"color": "#999999",
"backgroundColor": "#ffffff",
"borderStyle": "black",
"selectedColor": "#40404C",
"list": [
{
"pagePath": "pages/xxx",
"text": "首页",
"iconPath": "images/home.png",
"selectedIconPath": "images/homd1.png"
}
........
]
}
projectPath: './dist/',
"text": "首页",
在CI机器上一直报路径有问题
Error: ENOENT: no such file or directory, open 'schema/dist/game.json'
at Object.openSync (fs.js:462:3)
at Object.writeFileSync (fs.js:1375:35)
at mergeOnlineConfig (C:\Program Files\nodejs\node_modules\npm\node_modules\
miniprogram-ci\dist\validate\schemaValidate.js:1:1059)
at C:\Program Files\nodejs\node_modules\npm\node_modules\miniprogram-ci\dist
\validate\schemaValidate.js:1:2227
at processTicksAndRejections (internal/process/task_queues.js:97:5) { errno: -4058, syscall: 'open', code: 'ENOENT', path: 'schema/dist/game.json' } Error: ENOENT: no such file or directory, open 'schema/dist/plugin.json' at Object.openSync (fs.js:462:3) at Object.writeFileSync (fs.js:1375:35) at mergeOnlineConfig (C:\Program Files\nodejs\node_modules\npm\node_modules\ miniprogram-ci\dist\validate\schemaValidate.js:1:1059) at C:\Program Files\nodejs\node_modules\npm\node_modules\miniprogram-ci\dist \validate\schemaValidate.js:1:2227 at processTicksAndRejections (internal/process/task_queues.js:97:5) { errno: -4058, syscall: 'open', code: 'ENOENT', path: 'schema/dist/plugin.json' } Error: ENOENT: no such file or directory, open 'schema/dist/pluginpage.json' at Object.openSync (fs.js:462:3) at Object.writeFileSync (fs.js:1375:35) at mergeOnlineConfig (C:\Program Files\nodejs\node_modules\npm\node_modules\ miniprogram-ci\dist\validate\schemaValidate.js:1:1059) at C:\Program Files\nodejs\node_modules\npm\node_modules\miniprogram-ci\dist \validate\schemaValidate.js:1:2227 at processTicksAndRejections (internal/process/task_queues.js:97:5) { errno: -4058, syscall: 'open', code: 'ENOENT', path: 'schema/dist/pluginpage.json' } Error: ENOENT: no such file or directory, open 'schema/dist/projectconfig.json' at Object.openSync (fs.js:462:3) at Object.writeFileSync (fs.js:1375:35) at mergeOnlineConfig (C:\Program Files\nodejs\node_modules\npm\node_modules\ miniprogram-ci\dist\validate\schemaValidate.js:1:1059) at C:\Program Files\nodejs\node_modules\npm\node_modules\miniprogram-ci\dist \validate\schemaValidate.js:1:2227 at processTicksAndRejections (internal/process/task_queues.js:97:5) { errno: -4058, syscall: 'open', code: 'ENOENT', path: 'schema/dist/projectconfig.json' } Error: ENOENT: no such file or directory, open 'schema/dist/sitemap.json' at Object.openSync (fs.js:462:3) at Object.writeFileSync (fs.js:1375:35) at mergeOnlineConfig (C:\Program Files\nodejs\node_modules\npm\node_modules\ miniprogram-ci\dist\validate\schemaValidate.js:1:1059) at C:\Program Files\nodejs\node_modules\npm\node_modules\miniprogram-ci\dist \validate\schemaValidate.js:1:2227 at processTicksAndRejections (internal/process/task_queues.js:97:5) { errno: -4058, syscall: 'open', code: 'ENOENT', path: 'schema/dist/sitemap.json' } processing: app.json (node:3688) UnhandledPromiseRejectionWarning: Error: app.json: app.json SyntaxError: Unexpected token in JSON at position 0 at Object.throwError (C:\Program Files\nodejs\node_modules\npm\node_modules\ miniprogram-ci\dist\utils\common.js:1:274) at Object.checkJSONFormat (C:\Program Files\nodejs\node_modules\npm\node_mod ules\miniprogram-ci\dist\json\common.js:1:381) at Object.getAppJSON (C:\Program Files\nodejs\node_modules\npm\node_modules\ miniprogram-ci\dist\json\app\app.js:1:2143) at async Object.getAppJSON (C:\Program Files\nodejs\node_modules\npm\node_mo dules\miniprogram-ci\dist\json\app\app_merge_ext.js:1:577) at async Object.compileJSON (C:\Program Files\nodejs\node_modules\npm\node_m odules\miniprogram-ci\dist\compile\handler\mpjson.js:1:849) at async Object.compile (C:\Program Files\nodejs\node_modules\npm\node_modul es\miniprogram-ci\dist\compile\mini_program.js:1:894) at async Object.upload (C:\Program Files\nodejs\node_modules\npm\node_module s\miniprogram-ci\dist\upload\upload.js:1:1171) at async a (C:\Program Files\nodejs\node_modules\npm\node_modules\miniprogra m-ci\dist\cli.js:1:3187) (node:3688) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To termina te the node process on unhandled promise rejection, use the CLI flag `--unhandle d-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejectio ns_mode). (rejection id: 1) (node:3688) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre cated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
小程序代码怎么上传 请求大佬带路
感谢大佬的纠正, projectPath一定要配置对