npm 中文文档 npm 中文文档
指南
npmjs.com (opens new window)
指南
npmjs.com (opens new window)
  • 快速入门

    • npm 是什么?
    • npm 安装和更新
    • npm 防止权限错误
    • npm package.json 文件
    • npm 安装包
    • npm 更新包
    • npm 卸载包
    • npm 创建 Node.js 模块
    • npm 发布和更新包
    • npm 使用语义化版本
    • npm 使用 Dist-tags 标记包
    • npm 包和模块的了解
  • 命令行
  • 配置 npm

cnpm


cnpm: npm client for cnpmjs.org.

Requirements


Minimum Recommended
:--- :---
Node.js 14.0.0

Install


  1. ``` shell
  2. npm install cnpm -g
  3. ```

If you're in China, maybe you should install it from our China mirror :

  1. ``` shell
  2. npm install cnpm -g --registry=https://registry.npmmirror.com
  3. ```

Usage


Support all commands just like npm.

Sync packages from npm


  1. ``` shell
  2. cnpm sync [moduleName]
  3. ```

Open package document or git web url


  1. ``` shell
  2. cnpm doc [name]
  3. cnpm doc -g [name] # open git web url directly
  4. ```

Build your own private registry npm cli


  1. ``` shell
  2. $ npm install cnpm -g

  3. # then alias it
  4. $ alias mynpm='cnpm --registry=https://registry.npm.example.com \
  5.   --registryweb=https://npm.example.com \
  6.   --userconfig=$HOME/.mynpmrc'
  7. ```

Install with original npm cli


cnpm using npminstall by default. If you don't like symlink mode for node_modules, you can change the installer to original npm. But you will lose the fastest install speed.

  1. ``` shell
  2. cnpm i --by=npm react-native
  3. ```

License


MIT

Contributors


This project follows the git-contributor spec , auto updated at Sat May 14 2022 18:18:46 GMT+0800.

FOSSA Status
Last Updated: 2023-05-15 10:22:02