在docker容器中运行npm install时出错

尝试在我的泊坞窗容器中运行npm安装。 但我得到的是这样的:

pm WARN package.json yeti-ui@0.0.0 No repository field. npm ERR! notsup Unsupported npm ERR! notsup Not compatible with your operating system or architecture: fsevents@1.1.1 npm ERR! notsup Valid OS: darwin npm ERR! notsup Valid Arch: any npm ERR! notsup Actual OS: linux npm ERR! notsup Actual Arch: x64 npm ERR! System Linux 4.9.31-moby npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" npm ERR! cwd /home/chrome npm ERR! node -v v4.8.3 npm ERR! npm -v 1.4.21 npm ERR! code EBADPLATFORM npm WARN prefer global marked@0.3.6 should 

这就是我的docker形象的样子(我正在从一个预先构build的灵感:

 FROM debian:sid LABEL name="chrome-headless" \ maintainer="Justin Ribeiro <justin@justinribeiro.com>" \ version="1.4" \ description="Google Chrome Headless in a container" RUN apt-get update && apt-get install -y \ apt-transport-https \ ca-certificates \ curl \ gnupg \ --no-install-recommends \ && curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \ && echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list \ && apt-get update && apt-get install -y \ google-chrome-stable \ --no-install-recommends \ && apt-get purge --auto-remove -y curl gnupg \ && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install -y nodejs npm git RUN ln -s /usr/bin/nodejs /usr/bin/node RUN groupadd -r chrome && useradd -r -g chrome -G audio,video chrome \ && mkdir -p /home/chrome && chown -R chrome:chrome /home/chrome USER chrome WORKDIR /home/chrome ADD .npmrc .npmrc ADD package.json package.json COPY . . # RUN npm install (I have commented this out because the image could not be built for the same reason, so I thought it was easier to debug it if I manually try to run npm install when the container is up and running.) 

我发现一些论坛指出可能通过更新npm来解决。 我试图用这个命令npm install npm install npm @ latest来更新我的npm到最新版本,即使安装了最新版本,它似乎也没有使用最新版本。