在为我的 Angular 项目执行 docker build 时,在npm ci步骤中,出现以下错误:
Cannot read property '@angular/animations' of undefined
由于没有正确的错误,我们无法找到解决方案。
包和节点的版本:
到目前为止我已经尝试过:
Docker文件:
FROM docker-images.artifactory.dummydomain.com/db/node:14.18-alpine as build
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN npm install -g @angular/cli@15.2.8
RUN npm ci
RUN ng build --configuration=test
USER node
COPY --chown=node:node . .
Run Code Online (Sandbox Code Playgroud)
Package.json 文件依赖项:
"@angular/animations": "^15.2.9",
"@angular/cdk": "^15.2.9",
"@angular/common": "^15.2.9",
"@angular/compiler": "^15.2.9",
"@angular/core": "^15.2.9",
"@angular/forms": "^15.2.9",
"@angular/localize": …Run Code Online (Sandbox Code Playgroud) 尝试从node.js v12.6.0运行Windows批处理脚本并以正确的顺序实时捕获其输出。
但在测试过程中,stdout 和 stderr 的顺序经常(并非总是如此,但在 80% 的情况下)是混合的。
如何保持 stdout 和 stderr 的原始顺序?
这是我用于测试的 JavaScript 片段:
const spawn = require('child_process').spawn;
// Using 'inherit' to fix:
// "ERROR: Input redirection is not supported, exiting the process immediately".
const options = {
stdio: [
'inherit', // StdIn.
'pipe', // StdOut.
'pipe' // StdErr.
],
};
const child = spawn('exectest.cmd', options);
let mergedOut = '';
child.stdout.setEncoding('utf8');
child.stdout.on('data', (chunk) => {
process.stdout.write(chunk);
mergedOut += chunk;
});
child.stderr.setEncoding('utf8');
child.stderr.on('data', (chunk) => {
process.stderr.write(chunk);
mergedOut += …Run Code Online (Sandbox Code Playgroud)