错误:> 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
发布评论