cnpm时报错

问题:

最近在运行新项目时,安装依赖包时 cnpm install 报错。

cnpm : 无法将“cnpm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写 ,如果包括路径,请确保路径正确,然后再试一次。 所在位置 行:1 字符: 1

解决:

1、先查看是否安装了cnpm

npm list --depth=0 -global

 可以看到这里并没有cnpm

2、没有安装,执行命令

npm install -g cnpm --registry=https://registry.npm.taobao.org

再次运行 cnpm install即可。

原文地址:https://www.cnblogs.com/lpp-11-15/p/13408256.html