0
点赞
收藏
分享

微信扫一扫

计算机专业的未来展望

janedaring 2024-06-17 阅读 13

首先,确认 pnpm 是否已经安装:

ls /www/server/nodejs/v20.10.0/bin/pnpm

如果输出包含 pnpm,那么说明 pnpm 已经安装。

如果没有看到 pnpm,你可能需要重新安装它:

npm install -g pnpm

接下来,确保 PATH 包含 npm 安装的 bin 目录。

在你的 ~/.bashrc 或 ~/.bash_profile 文件中添加以下行,以确保所有路径都正确添加:

export PATH=$PATH:/www/server/nodejs/v20.10.0/bin

然后,重新加载你的 shell 配置文件:

source ~/.bashrc

再次尝试运行 pnpm -v 来验证安装是否成功:

pnpm -v

退出去重新进服务器可能还是没有pnpm

vim ~/.bash_profile

修改成这样

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/www/server/nodejs/v20.10.0/bin
export PATH

让文件配置生效

source ~/.bash_profile
举报

相关推荐

0 条评论