node.js - cnpm不是内部或外部命令
阿神
阿神 2017-04-17 14:48:35
0
2
787

使用淘宝镜像安装cnpm,使用命令:
$ npm install cnpm -g --registry=https://registry.npm.taobao.org
之后输入cnpm -v,显示cnpm不是内部或外部命令,也不是可运行命令或批处理文件
node -v 5.0.0
npm-v 3.3.6
应该不是node和npm的问题,想请教一下这是什么原因呢?怎么解决?要使用less和gulp,安装cnpm很有必要的..

阿神
阿神

闭关修行中......

reply all(2)
巴扎黑

Just configure the taobao image registry directly for npm. It is not necessary to install cnpm

npm config set registry https://registry.npm.taobao.org

Then use npm install gulp less --save-dev directly to get the package from the taobao image

刘奇

Open

C:\Users(用户)\你的用户名\.npmrc 

Change this file
to

prefix=C:\Program Files\nodejs\node_modules
cache=C:\Program Files\nodejs\node_cache
registry = http://registry.cnpmjs.org

The first two are the two folders under the node installation path

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template