美文网首页Vue 相关
npm command not found

npm command not found

作者: 24KBING | 来源:发表于2019-11-05 10:33 被阅读0次
    2

    出现的问题

    从官网下载了 node.pkg 文件安装 node,安装好后,在 mac 终端下输入 npm -vnode -v 均提示 command not found

    解决办法

    1、第一步:创建 .bash_profile 文件,~表示在~目录下,.表示隐藏文件,打开终端,输入命令如下:

    touch ~/.bash_profile
    

    2、第二步:打开 .bash_profile 文件,输入命令如下:

    open -e .bash_profile
    

    3、第三步:这时候会弹出 .bash_profile 文本编辑框,在文本编辑框里面编辑:

    export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
    

    4、第四步:command+s 保存 .bash_profile 文件,为使 .bash_profile 文件生效,输入命令:

    source .bash_profile
    

    5、第五步:再输入 npm -v 或者 node -v 就能看到版本号啦~。

    node -v
    
    npm -v
    

    相关文章

      网友评论

        本文标题:npm command not found

        本文链接:https://www.haomeiwen.com/subject/xrrsbctx.html