说明:
以下操作是管理员权限,系统是Ubuntu16.04
安装npm工具,指令如下
apt install npm
指定apidoc版本安装,指令如下
npm install apidoc@0.17.6 -g
安装之后,使用如下指令出现警告信息
root@wgl-virtual-machine:/home/aatest# apidoc -i src/ apiDoc
info: Done.
(node:22298) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
解决方案
这是由于node.js版本过高引起的,所以需要降版本
需要先安装node.js安装管理工具n,指令如下
apt install n
安装指定版本node.js,指令如下
n 12.18.3
或者
n v12.18.3