Looks like it’s a bug of npm . https://github.com/appium/appium/issues/7525#issuecomment-266800539
I did switch back to older version of npm and able to install appium on android-docker.
npm uninstall -g appium
npm install -g npm@4.0.5
npm install -g appium