1

mac 下无法上传截图啊,什么鬼

在腾讯云服务器中输入命令得到一下结果

whereis pm2


pm2: /usr/bin/pm2 /usr/local/node-v6/bin/pm2


{
    "apps": [{
        "name": "music",
        "script": "server.js",
        "env": {
            "COMMON_VARIABLE": "true"
        },
       "env_production": {
           "NODE_ENV": "production"
       }
    }],
    "deploy": {
        "production": {
            "user": "root",
            "host": ["115.159.109.124"],
            "ref": "origin/master",
            "repo": "git@gitee.com:landluck/server.git",
            "path": "/home/ice/production",
            "ssh_options": "StrictHostKeyChecking=no",
            "post-deploy" : "npm install && pm2 startOrRestart ecosystem.json --env production",
            "pre-deploy-local": "echo 'Deploy Done'",
            "env": {
                "NODE_ENV": "production"
            }
        }
    }
}
--> Deploying to production environment
--> on host 115.159.109.124
  ○ deploying origin/master
  ○ executing pre-deploy-local
Deploy Done
  ○ hook pre-deploy
  ○ fetching updates
  ○ full fetch
Fetching origin
  ○ resetting HEAD to origin/master
HEAD is now at 9c3f5df pm2 config
  ○ executing post-deploy `export NODE_ENV=production && npm install && pm2 startOrRestart ecosystem.json --env production`
npm WARN enoent ENOENT: no such file or directory, open '/home/ice/production/source/package.json'
npm WARN source No description
npm WARN source No repository field.
npm WARN source No README data
npm WARN source No license field.
bash: pm2: command not found

  post-deploy hook failed

Deploy failed
2018-04-06 提问
1 个回答
0

应该是查找命令路径的问题。我也遇到了同样地问题,我是按以下方式解决的:
sudo ln -s "$NVM_DIR/versions/node/v11.8.0/bin/pm2" "/usr/local/bin/pm2"
其中"$NVM_DIR/versions/node/v11.8.0/bin/pm2"是我运行whereis pm2的得出的路径

撰写答案

推广链接