最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

错误:> TypeError [ERR

网站源码admin34浏览0评论

错误:> 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);
}

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

回答如下:

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论