首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在阿尔卑斯Linux映像中,我得到了‘`nvm:命令未找到’

在阿尔卑斯Linux映像中,我得到了‘`nvm:命令未找到’
EN

Stack Overflow用户
提问于 2022-09-27 14:58:14
回答 3查看 441关注 0票数 1

我已经阅读了nvm项目的自述文件,其中列出了我需要安装的包,尽管我不得不将python2包修改为python3,因为前一个包是在Alpin3.13发布之后被废弃的,因为节点可以在python3包上运行。下面是我的Dockerfile,它是我在Codespace上运行的.devcontainer目录的一部分:

代码语言:javascript
运行
复制
# Pull the Alpine 3.15 Docker image
FROM alpine:3.16

# Enter the BASH shell
ENTRYPOINT [ "/bin/bash" ]

# Add packages without caching, but while upgrading Alpine
RUN apk add --no-cache -U\
    curl bash ca-certificates\
    openssl ncurses coreutils\
    python3 make gcc g++\
    libgcc linux-headers grep\
    util-linux binutils findutils

RUN touch ~/.bashrc

# Install NVM and source it
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
RUN echo '\
export NVM_DIR="~/.nvm" \
[-s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" \
[[ -r $NVM_DIR/bash_completion ]] && \. $NVM_DIR/bash_completion\
' >~/.bashrc

# Run the usual setup NVM commands
RUN [ "/bin/bash", "-c", "nvm install -s --lts --latest-npm" ]
RUN [ "/bin/bash", "-c", "nvm alias default lts/*" ]

# Install NPM packages and run the dev server
RUN [ "/bin/bash", "-c", "npm i" ]
CMD [ "/bin/bash", "-c", "npm run dev" ]

下面是我的creation.log文件中的一行,它表示错误:

代码语言:javascript
运行
复制
2022-09-27 14:44:57.546Z: #9 [6/8] RUN [ "/bin/bash", "-c", "nvm install -s --lts --latest-npm" ]
2022-09-27 14:44:58.134Z: #9 0.539 /bin/bash: line 1: nvm: command not found
2022-09-27 14:44:58.229Z: #9 ERROR: executor failed running [/bin/bash -c nvm install -s --lts --latest-npm]: exit code: 127

如果还需要什么,请告诉我!谢谢你的帮助!

EN

Stack Overflow用户

发布于 2022-09-27 16:54:23

我不会在python/Node应用程序中使用基于alpine的图像,

标准PyPI车轮在高山上不起作用

现在大多数Python包都包含了PyPI上的二进制文件,大大加快了安装时间。但是,如果您使用的是阿尔卑斯Linux,则需要在您使用的每个Python包中编译所有C代码。

请参见这里的最终问题,您可以使用https://pythonspeed.com/articles/alpine-docker-python/

更新

至于Node应用程序

请参阅https://www.youtube.com/watch?v=mA8wtTUCdgc

你可以解决这个问题,然后另一个会出现,等等.

票数 0
EN
查看全部 3 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73869723

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档