Skip to content
Huan LI edited this page Aug 18, 2018 · 24 revisions

NPM Version Downloads

$ npm install --save wechaty
$ node mybot.js

Use NPM in China

There could be some issue when using npm install in China due to Internet Censorship by GFW(Great Fire Wall).

If you have this kind of issue, you need to switch to use NPM Registry Mirror from Taobao instead of using the default NPM Registry.

You can start to use NPM Registry Mirror from Taobao by any of the following three methods:

1. Temporary

npm --registry https://registry.npm.taobao.org install wechaty

2. Permanently

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

npm install wechaty

3. Alias

alias cnpm="npm --registry=https://registry.npm.taobao.org \
    --cache=$HOME/.npm/.cache/cnpm \
    --disturl=https://npm.taobao.org/dist \
    --userconfig=$HOME/.cnpmrc"

cnpm install wechaty

Learn more about Taobao Mirror for NPM from:

Have problem in npm install chromedriver

If your server is inside China, use CDN instead of install directly will great help you to get it done.

npm install chromedriver --chromedriver_cdnurl=https://npm.taobao.org/mirrors/chromedriver

NPM Development Tools

Publish version next to latest

$ npm dist-tag add [email protected] latest

package.json

{
  "publishConfig": {
    "tag": "next"
  }
}

Git Push for a Single Tag

$ NO_HOOK=1 git push origin <tag_name>

NO_HOOK is introduced here because if we are using the pre-push hook, then we need to disable it to push tag. The pre-push script file for Wechaty lives here

How to public a scoped package on NPM for free

npm login --scope=chatie
npm --access=public publish

See Also:

PUBLISH

When we need to publish a STABLE version(the minor version is even), we need to make sure the following modules is all STABLE version:

  • wechaty-puppet
  • wechaty-puppet-puppeteer
  • wechaty-puppet-mock
  • wechaty-puppet-wechat4u
  • wechaty-puppet-padchat
  • wechaty-puppet-ioscat
  • wechaty-puppet-hostie
  • wechaty - Update CHANGELOG
  • wechaty