9***@qq.com
9***@qq.com
  • 发布:2022-05-30 13:53
  • 更新:2022-06-02 16:01
  • 阅读:1103

uni-app打包小程序插件,命令执行不起来

分类:uni-app

"dev:mp-ali-plugin": "yarn dev:custom mp-ali-plugin --plugin"

提示m@kimdeMacBook-Pro test-plugin-ali % yarn dev:mp-wx-plugin
yarn run v1.22.11
warning ../../../package.json: No license field
$ yarn dev:custom mp-wx-plugin --plugin
warning ../../../package.json: No license field
error Command "dev:custom" not found.

2022-05-30 13:53 负责人:无 分享
已邀请:
DCloud_UNI_LXH

DCloud_UNI_LXH

在你的 package.jsonscripts 节点中是否有这条 "dev:custom": "cross-env NODE_ENV=development uniapp-cli custom"

  • 9***@qq.com (作者)

    之前没有添加,添加后,还是报错,麻烦您在帮忙看一下

    2022-06-02 15:50

9***@qq.com

9***@qq.com (作者)

package.json 的 scripts 里 这个配置的

"scripts": {
"dev:custom": "cross-env NODE_ENV=development uniapp-cli custom",
"dev:mp-ali-plugin": "yarn dev:custom mp-ali-plugin --plugin"
}

下面是执行结果:

kim@kimdeMacBook-Pro tinyzk-2c-app % yarn dev:mp-ali-plugin
yarn run v1.22.11
warning ../../../../../package.json: No license field
$ yarn dev:custom mp-ali-plugin --plugin
warning ../../../../../package.json: No license field
$ cross-env NODE_ENV=development uniapp-cli custom mp-ali-plugin --plugin
events.js:377
throw er; // Unhandled 'error' event
^

Error: spawn uniapp-cli ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:467:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
at onErrorNT (internal/child_process.js:467:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn uniapp-cli',
path: 'uniapp-cli',
spawnargs: [ 'custom', 'mp-ali-plugin', '--plugin' ]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

DCloud_UNI_LXH

DCloud_UNI_LXH

uni-app 打包为小程序插件只支持 cli 项目

该问题目前已经被锁定, 无法添加新回复