为什么我在运行"docker run nodeWeb"时出现'/bin/sh: [npm,: not found'错误?



我的 docker 镜像名称是

simpleweb2

这是我的码头工人文件:

#base Image
FROM node:alpine
#install dependencies
COPY ./ ./
RUN npm install
#default command
CMD ['npm', 'start']

构建并运行以下命令后

docker run simpleweb2

我收到此错误

/bin/sh: [npm,: not found

如果要运行NPM命令,则必须选择基本映像作为节点而不是高山

节点:阿尔卑斯==>拉动阿尔卑斯节点图像

# Specify the Base image
From node:alpine
# Install some dependencies
RUN npm Install
# Default command
CMD ["npm", "start"]

最新更新