错误:> TypeError [ERR

编程入门 行业动态 更新时间:2024-09-27 09:22:19

<a href=https://www.elefans.com/category/jswz/34/1771449.html style=错误:> TypeError [ERR"/>

错误:> TypeError [ERR

帮助我解决发布管道中节点 14(也尝试过节点 16/18)面临的问题。

错误:> TypeError [ERR_INVALID_ARG_TYPE]:“mode”参数必须是整数。收到类型函数([函数(匿名)])

现有代码:

console.log(
    '    :: INFO => Copying CF Update Stack File to GCDeploy Folder...'
);
fs.copyFileSync(
    serviceDir +
        '/' +
        slsFolder +
        sls_env +
        '/cloudformation-template-update-stack.json',
    serviceDir + '/gcdeploy/cloudformation-template-update-stack.json',
    (err) => {
        if (err) {
            _errorCount++;
            _errorsOccurred = true;
            throw err;
        }
    }
);
console.log('    :: INFO => Complete\n\n');

尝试了以下修改,但没有成功

const fs = require('fs');
console.log('    :: INFO => Copying CF Update Stack File to GCDeploy Folder...');
const sourceFilePath = serviceDir + '/' + slsFolder + sls_env + '/cloudformation-template-update-stack.json';
const destinationFilePath = serviceDir + '/gcdeploy/cloudformation-template-update-stack.json';

try {
  fs.copyFileSync(sourceFilePath, destinationFilePath);
  // Set desired permissions on the copied file (e.g., 755)
  fs.chmodSync(destinationFilePath, 0o755);
  console.log('    :: INFO => Complete\n\n');
} catch (err) {
  _errorCount++;
  _errorsOccurred = true;
  console.error('Error copying CF Update Stack File:', err);
}

运行发布管道来部署代码时

回答如下:

更多推荐

错误:> TypeError [ERR

本文发布于:2024-05-31 07:20:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1771411.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   gt   ERR   TypeError

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!