zhs[@ubuntu](/user/ubuntu):~/Desktop/node-v0.10.26$ pm2 -V
0.7.8
zhs[@ubuntu](/user/ubuntu):~/Desktop/node-v0.10.26$ pm2 start
/usr/local/lib/node_modules/pm2/bin/pm2:383
fs.exists(cst.DEFAULT_FILE_PATH, function(exist) {
^
TypeError: Object #<Object> has no method 'exists'
at init (/usr/local/lib/node_modules/pm2/bin/pm2:383:6)
at Object.<anonymous> (/usr/local/lib/node_modules/pm2/bin/pm2:403:3)
at Module._compile (module.js:446:26)
at Object..js (module.js:464:10)
at Module.load (module.js:353:32)
at Function._load (module.js:311:12)
at Array.0 (module.js:484:10)
at EventEmitter._tickCallback (node.js:190:39)
[ 'Stats’, 'readFile’, 'readFileSync’, 'close’, 'closeSync’, 'open’, 'openSync’, 'read’, 'readSync’, 'write’, 'writeSync’, 'rename’, 'renameSync’, 'truncate’, 'truncateSync’, 'rmdir’, 'rmdirSync’, 'fdatasync’, 'fdatasyncSync’, 'fsync’, 'fsyncSync’, 'mkdir’, 'mkdirSync’, 'sendfile’, 'sendfileSync’, 'readdir’, 'readdirSync’, 'fstat’, 'lstat’, 'stat’, 'fstatSync’, 'lstatSync’, 'statSync’, 'readlink’, 'readlinkSync’, 'symlink’, 'symlinkSync’, 'link’, 'linkSync’, 'unlink’, 'unlinkSync’, 'fchmod’, 'fchmodSync’, 'chmod’, 'chmodSync’, 'fchown’, 'fchownSync’, 'chown’, 'chownSync’, '_toUnixTimestamp’, 'utimes’, 'utimesSync’, 'futimes’, 'futimesSync’, 'writeFile’, 'writeFileSync’, 'watch’, 'watchFile’, 'unwatchFile’, 'realpathSync’, 'realpath’, 'createReadStream’, 'ReadStream’, 'FileReadStream’, 'createWriteStream’, 'WriteStream’, 'FileWriteStream’, ‘SyncWriteStream’ ] ‘v0.6.19’
@zhs077 我刚才说的有点问题,先要在当前文件安装pm2,这步骤出问题就撞墙死了吧.然后将node_modules下的pm2移动到node的全局node_modules里面,例如0.11.9/node_modules这样的路径之下,然后在node的bin目录下用ln命令将node_modules中的pm2/bin目录下的pm2的可执行程序链接到node的bin目录中就可以了。