我刚刚安装Node.js和npm(用于其他模块).
如何将Node.js和我正在使用的模块更新到最新版本?
可以npm这样做,还是我必须删除并重新安装Node.js和npm才能获得下一个版本?
我按照本npm节中的步骤操作.
我有以下 Dockerfile:
FROM ubuntu
USER root
RUN apt-get update && apt-get install curl -y
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get update && apt-get upgrade -y && apt-get install nodejs -y
RUN mkdir /opt/public
RUN mkdir /opt/bin
ADD public /opt/public
ADD bin /opt/bin
RUN ls -lah /opt/bin
RUN ls -lah /opt/public
ADD run.sh /bin/run.sh
RUN chmod +x /bin/run.sh
RUN cd /opt/bin && npm install
CMD ["/bin/run.sh"]
Run Code Online (Sandbox Code Playgroud)
当我构建容器时,我得到这个错误:
/bin/sh: 1: npm: 未找到
问题是什么?请你帮助我好吗?