使用的是离线方式的安装,pm2-4.5.1.tar.gz
安装在了root文件夹下,
然后执行了 In -s /root/pm2/bin/pm2 /usr/local/bin/pm2后,
执行pm2 -v,报了以下错误:
internal/modules/cjs/loader.js:969
throw err;
^
Error: Cannot find module 'debug'
Require stack:
- /root/pm2/constants.js
- /root/pm2/lib/binaries/CLI.js
- /root/pm2/bin/pm2
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
at Function.Module._load (internal/modules/cjs/loader.js:842:27)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/root/pm2/constants.js:7:14)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Module.require (internal/modules/cjs/loader.js:1026:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/root/pm2/constants.js',
'/root/pm2/lib/binaries/CLI.js',
'/root/pm2/bin/pm2'
]
}
请问错误要怎么解决?