gpt4 book ai didi

cordova - Cordova 构建任务时获取 "TypeError: file argument must be a non-empty string"

转载 作者:行者123 更新时间:2023-12-02 02:59:14 25 4
gpt4 key购买 nike

我正在 VSTS 中运行 Cordova 构建任务,为 iOS 构建附加的签名文件:

enter image description here

但是,当我执行任务时,出现以下错误:

TypeError: "file" argument must be a non-empty string
at normalizeSpawnArguments (child_process.js:383:11)
at spawnSync (child_process.js:519:38)
at /Users/dummyuser/Desktop/dev/agent/_work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/lib/xcode-task-utils.js:55:31
at _fulfilled (/Users/dummyuser/Desktop/dev/agent/_work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/node_modules/q/q.js:854:54)
at self.promiseDispatch.done (/Users/dummyuser/Desktop/dev/agent/_work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/node_modules/q/q.js:883:30)
at Promise.promise.promiseDispatch (/Users/dummyuser/Desktop/dev/agent/_work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/node_modules/q/q.js:816:13)
at /Users/dummyuser/Desktop/dev/agent/_work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/node_modules/q/q.js:877:14
at runSingle (/Users/dummyuser/Desktop/dev/agent/_work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/node_modules/q/q.js:137:13)
at flush (/Users/dummyuser/Desktop/dev/agent/_work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/node_modules/q/q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:131:7)

通过child_process的代码回溯,我非常有信心发生此错误,因为文件参数不是字符串。以下是调用链的片段:

xcode-util-task.js

var spawnResult = spawn(createKeychain, createKeychainArgs, { stdio: "inherit" });

child_process.js

function spawnSync() {
var opts = normalizeSpawnArguments.apply(null, arguments);

...

function normalizeSpawnArguments(file, args, options) {
if (typeof file !== 'string' || file.length === 0)
throw new TypeError('"file" argument must be a non-empty string');

的确如此。 spawn() 的第一个参数 createKeychain 是一个对象而不是字符串。打印对象时得到以下信息:

{ [String: '/bin/bash']
stdout: '/bin/bash',
stderr: null,
code: 0,
cat: [Function: bound ],
exec: [Function: bound ],
grep: [Function: bound ],
head: [Function: bound ],
sed: [Function: bound ],
sort: [Function: bound ],
tail: [Function: bound ],
to: [Function: bound ],
toEnd: [Function: bound ],
uniq: [Function: bound ] }

我确定我遗漏了什么,但这感觉像是 Cordova Build 扩展中的错误。

仅供引用节点:8.9.1,NPM:5.5.1, Cordova 构建:1.3.11

最佳答案

有完全相同的问题...它是由代理上的 NodeJS 版本 (8.x) 引起的。降级到 6.x 之后,该步骤开始工作 ;)

也可以在您的构建中添加“使用 Node 6.x”任务..

关于cordova - Cordova 构建任务时获取 "TypeError: file argument must be a non-empty string",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47360608/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com