更新:所以我发现了一个“解决方案”我无法命名容器客户端。我必须有一个隐藏的容器,我不能删除
因此,我正在尝试为平均堆栈设置docker文件环境,在更改时重新启动角色时遇到问题。我尝试了一些东西并且正在测试以确保它是Docker composeb但是现在当我尝试运行docker文件时它会得到npm install然后有npm错误
我必须指出我完全卸载了角度nodejs npm和docker仍然存在问题
Step 2/8 : RUN mkdir -p /usr/src/app
---> Using cache
---> 3d1dc570d73c
Step 3/8 : WORKDIR /usr/src/app
---> Using cache
---> 6ee5da6bd050
Step 4/8 : COPY package.json /usr/src/app
---> Using cache
---> 2b7d8e3010d5
Step 5/8 : RUN npm install
---> Running in 90163baffdb6
npm WARN deprecated nodemailer@2.7.2: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm ERR! code ERR_STREAM_WRITE_AFTER_END
npm ERR! write after end
npm ERR! code ERR_STREAM_WRITE_AFTER_END
npm ERR! write after end
npm ERR! code ERR_STREAM_WRITE_AFTER_END
npm ERR! write after end
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-03-02T20_12_17_764Z-debug.log
The command '/bin/sh -c npm install' returned a non-zero code: 1
错误日志
15037 silly pacote data for sha1-4PyVEztu8nbNyIh82vJKpvFW+Po= not present. Using manifest.
15038 verbose stack Error: write after end
15038 verbose stack at writeAfterEnd (_stream_writable.js:236:12)
15038 verbose stack at PassThrough.Writable.write (_stream_writable.js:287:5)
15038 verbose stack at PassThrough.Writable.end (_stream_writable.js:553:10)
15038 verbose stack at ReadEntry.entry.on (/home/jacob/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/pacote/lib/extract-stream.js:19:41)
15038 verbose stack at emitOne (events.js:121:20)
15038 verbose stack at ReadEntry.emit (events.js:211:7)
15038 verbose stack at ReadEntry.emit (/home/jacob/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:287:25)
15038 verbose stack at ReadEntry.[maybeEmitEnd] (/home/jacob/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:240:12)
15038 verbose stack at ReadEntry.end (/home/jacob/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:153:27)
15038 verbose stack at Unpack.[consumeBody] (/home/jacob/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/tar/lib/parse.js:210:13)
15038 verbose stack at Unpack.[consumeChunkSub] (/home/jacob/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/tar/lib/parse.js:391:40)
15038 verbose stack at Unpack.[consumeChunk] (/home/jacob/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/tar/lib/parse.js:362:30)
15038 verbose stack at Unzip.(anonymous function).on.chunk (/home/jacob/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/tar/lib/parse.js:291:59)
15038 verbose stack at emitOne (events.js:116:13)
15038 verbose stack at Unzip.emit (events.js:211:7)
15038 verbose stack at Unzip.emit (/home/jacob/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:287:25)
15039 verbose cwd /
15040 verbose Linux 4.10.0-38-generic
15041 verbose argv "/home/jacob/.nvm/versions/node/v8.9.4/bin/node" "/home/jacob/.nvm/versions/node/v8.9.4/bin/npm" "install" "-g" "@angular/cli"
15042 verbose node v8.9.4
15043 verbose npm v5.7.1
15044 error write after end
15045 verbose exit [ 1, true ]
答案 0 :(得分:0)
我遇到了同样的问题,解决方案是将package-lock.json添加到docker容器中,并确保没有为容器添加内置的角度应用程序。
答案 1 :(得分:0)
issue个pacote包中的npm issue npm 5.7.1取决于。 Destructuring Assignment要关注。
将npm降级为5.6.0版本:
npm install -g npm@5.6.0