小编ume*_*hta的帖子

npm ci 命令失败并显示“无法读取未定义的属性‘@angular/animations’”

在为我的 Angular 项目执行 docker build 时,在npm ci步骤中,出现以下错误: Cannot read property '@angular/animations' of undefined

由于没有正确的错误,我们无法找到解决方案。

包和节点的版本:

  • @角度/动画 - 15.2.9
  • Node.Js - 18.14.2
  • 国家公共管理 - 9.5
  • 角度 CLI - 15.2.8

到目前为止我已经尝试过:

  • 交叉检查动画模块的 package.json 文件
  • 尝试降级@angular/animations版本
  • 删除package-lock.json文件和node_module目录
  • 删除缓存并尝试过

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 npm angular

13
推荐指数
1
解决办法
1万
查看次数

Node.js 生成:保持 StdOut 和 StdErr 保持原始顺序

尝试从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)

javascript batch-file race-condition spawn node.js

4
推荐指数
1
解决办法
6023
查看次数

标签 统计

node.js ×2

angular ×1

batch-file ×1

javascript ×1

npm ×1

race-condition ×1

spawn ×1