zoukankan      html  css  js  c++  java
  • mac下的环境变量配置- cnpm :command not found

    安装cnpm后 cnpm -v却找不到

    首先确认一下 npm 下载包路径: 

    一.查看npm的prefix和cache设置信息 

    1|npm config get prefix
    2|npm config get cache

    二.设置下载路径和缓存路径

    1|npm config set prefix “usr/example”
    2|npm config set cache “usr/example“

    三.查看npm配置下信息

    1|npm config list

    然后配置cnpm的环境变量

    环境变量 :记录电脑各种内容的位置
    如何设置 : export PATH=path1/example:$PATH 

    一.新建并打开 .bash_profile 文件

    1|cd  ~
    2|touch .bash_profile
    3|open .bash_profile

    二.添加cnpm的路径 保存 退出,设置全局路径

    1|export PATH=$PATH:/Users/你的用户/example/bin
    2|source .bash_profile

    通常node和npm命令都安装在 usr/local/bin路径下,如果不将这个路径添加到path变量里,通

    过npm安装的的各种包都会not found;所以要记得操作:

    export PATH="$PATH:/usr/local/bin"
  • 相关阅读:
    The nineteenth day
    The eighteen day
    弱读下
    弱读上
    失爆 爆破音
    连读
    The seventeenth day
    The sixteenth day
    React 官方脚手架 create-react-app快速生成新项目
    pc端引入微信公众号文章
  • 原文地址:https://www.cnblogs.com/noraZhang/p/12617115.html
Copyright © 2011-2022 走看看