【发布时间】:2017-07-12 17:45:55
【问题描述】:
纱线版本:0.21.2
Nodejs 版本:6.9 和 4.7
在本地运行纱线时,它可以工作
运行 npm install 时,它可以工作
运行 yarn install Dockerfile (docker build .) 时失败:error Couldn't find a package.json file in "/root/.cache/yarn/npm-readable-stream-2.2.2-a9e6fec3c7dda85f8bb1b3ba7028604556fc825e"
我完全不知道为什么。
Step 16 : RUN yarn install
---> Running in 917c2b1b57fb
yarn install v0.21.2
[1/4] Resolving packages...
[2/4] Fetching packages...
error Couldn't find a package.json file in "/root/.cache/yarn/npm-readable-stream-2.2.2-a9e6fec3c7dda85f8bb1b3ba7028604556fc825e"
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
The command '/bin/sh -c yarn install' returned a non-zero code: 1
Yarn 是这样安装在 Dockerfile 中的
RUN curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 0.21.2
ENV PATH /root/.yarn/bin:$PATH
【问题讨论】:
-
我遇到了一个类似的问题——你知道是什么导致了你的问题吗?
-
这里有什么更新吗? @Bart 你明白了吗?
-
我在运行
yarn install之前添加了yarn cache clean。它现在可以工作,但我认为这不是正确的解决方案。 -
@ChristianSaiki 已经有一段时间了,不幸的是我不记得了!
-
请提供您正在使用的 Dockerfile 的全部内容。为了重现和解决问题,需要它。