cnpm不是內(nèi)部命令 cnpm: command not found 的解決方案
command not found這種問(wèn)題一般有兩個(gè)原因:
1、命令沒(méi)有安裝成功
2、環(huán)境變量沒(méi)有配置
安裝命令
$ npm install -g cnpm --registry=https://registry.npm.taobao.org
配置cnpm的環(huán)境變量
一.新建并打開(kāi) .bash_profile 文件
1|cd ~
2|touch .bash_profile
3|open .bash_profile
二、添加npm模塊安裝位置
export PATH=$PATH:/Volumes/Development/code/node_modules/bin
三、保存后退出,刷新配置文件使其生效。
source .bash_profile