"D:\Program Files\JetBrains\WebStorm 2018.2\bin\runnerw.exe" "D:\Program Files\nodejs\node.exe" "D:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" run deploy_setup --scripts-prepend-node-path=auto
> [email protected] deploy_setup E:\WebstormProjects\coreProject
> pm2 deploy pm2.config.json production setup
--> Deploying to production environment
--> on host 185.***.***.***
Deploy failed
spawn sh ENOENT
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] deploy_setup: `pm2 deploy pm2.config.json production setup`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] deploy_setup script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Roaming\npm-cache\_logs\2018-08-02T04_18_36_332Z-debug.log
Process finished with exit code 1
pm2 deploy pm2.config.json production setup
{
"apps": [
{
"name": "coreProject",
"script": "./dist/main.js",
"watch": "./dist",
"ignore_watch": [
"./node_modules",
".src"
],
"max_memory_restart": "800M",
"instances": "max",
"exec_mode": "cluster",
"force": false,
"append_env_to_name": true,
"env": {
"NODE_ENV": "development"
},
"env_production": {
"NODE_ENV": "production"
}
}
],
"deploy": {
"production": {
"user": "root",
"host": "185.***.***.***",
"ref": "origin/master",
"repo": "root@git.***.com:***/coreProject.git",
"path": "/www/wwwroot/coreProject",
"post-deploy": "npm install",
"ssh_options": "StrictHostKeyChecking=no"
}
}
}
$ pm2 report
[2018-08-02T12:16:49.906Z] PM2 log: ===============================================================================
[2018-08-02T12:16:49.916Z] PM2 log: --- New PM2 Daemon started ----------------------------------------------------
[2018-08-02T12:16:49.917Z] PM2 log: Time : Thu Aug 02 2018 12:16:49 GMT+0800 (GMT+08:00)
[2018-08-02T12:16:49.917Z] PM2 log: PM2 version : 3.0.3
[2018-08-02T12:16:49.918Z] PM2 log: Node.js version : 10.8.0
[2018-08-02T12:16:49.918Z] PM2 log: Current arch : x64
[2018-08-02T12:16:49.918Z] PM2 log: PM2 home : C:\Users\admin\.pm2
[2018-08-02T12:16:49.918Z] PM2 log: PM2 PID file : C:\Users\admin\.pm2\pm2.pid
[2018-08-02T12:16:49.918Z] PM2 log: RPC socket file : \\.\pipe\rpc.sock
[2018-08-02T12:16:49.919Z] PM2 log: BUS socket file : \\.\pipe\pub.sock
[2018-08-02T12:16:49.919Z] PM2 log: Application log path : C:\Users\admin\.pm2\logs
[2018-08-02T12:16:49.919Z] PM2 log: Process dump file : C:\Users\admin\.pm2\dump.pm2
[2018-08-02T12:16:49.919Z] PM2 log: Concurrent actions : 2
[2018-08-02T12:16:49.919Z] PM2 log: SIGTERM timeout : 1600
[2018-08-02T12:16:49.920Z] PM2 log: =============================================================================
$ npm report
0 info it worked if it ends with ok
1 verbose cli [ 'D:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'deploy_setup',
1 verbose cli '--scripts-prepend-node-path=auto' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predeploy_setup', 'deploy_setup', 'postdeploy_setup' ]
5 info lifecycle [email protected]~predeploy_setup: [email protected]
6 info lifecycle [email protected]~deploy_setup: [email protected]
7 verbose lifecycle [email protected]~deploy_setup: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~deploy_setup: PATH: D:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\WebstormProjects\coreProject\node_modules\.bin;D:\Python27\;D:\Python27\Scripts;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;D:\Program Files\Git\cmd;D:\Program Files\Java\jdk\bin;D:\Go\bin;D:\Program Files (x86)\Yarn\bin\;D:\Program Files\nodejs\;D:\Program Files\Microsoft VS Code\bin;D:\Program Files\Process Lasso\;C:\Users\admin\AppData\Local\Microsoft\WindowsApps;D:\Program Files\Bandizip\;%GOPATH%\bin;D:\Program Files\Microsoft VS Code\bin;C:\Users\admin\AppData\Local\Yarn\bin;C:\Users\admin\AppData\Roaming\npm
9 verbose lifecycle [email protected]~deploy_setup: CWD: E:\WebstormProjects\coreProject
10 silly lifecycle [email protected]~deploy_setup: Args: [ '/d /s /c', 'pm2 deploy pm2.config.json production setup' ]
11 silly lifecycle [email protected]~deploy_setup: Returned: code: 1 signal: null
12 info lifecycle [email protected]~deploy_setup: Failed to exec deploy_setup script
13 verbose stack Error: [email protected] deploy_setup: `pm2 deploy pm2.config.json production setup`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (D:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:304:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess.<anonymous> (D:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:182:13)
13 verbose stack at maybeClose (internal/child_process.js:962:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:249:5)
14 verbose pkgid [email protected]
15 verbose cwd E:\WebstormProjects\coreProject
16 verbose Windows_NT 10.0.17134
17 verbose argv "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "deploy_setup" "--scripts-prepend-node-path=auto"
18 verbose node v10.8.0
19 verbose npm v6.2.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] deploy_setup: `pm2 deploy pm2.config.json production setup`
22 error Exit status 1
23 error Failed at the [email protected] deploy_setup script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Hi @newcomein
Is the path correct : "path": "/www/wwwroot/coreProject"
It should be "path": "/www/root/coreProject", no ?
@wallet77 Try it next time, and use webhook
@wallet77 But I operated under the condition of broken network, that is, the Deploy request was not issued.
@newcomein spawn sh ENOENT with pm2-deploy can occurred if configuration is wrong.
@wallet77 Only these are the configuration items for Deploy
Have you fixed this problem?
@zsodur no
In windows, try to use git bash, using vscode shell or powershell will get this error
On windows there is no 'sh' executable that is why this is giving error.
To resolve this issue include 'C:\Program Files\Git\bin' to the path variable as only this folder has sh.exe present.
after adding restart any code GUIs with integrated terminal like VS Code. and tada your issue is resolved.
On windows there is no 'sh' executable that is why this is giving error.
To resolve this issue include 'C:\Program Files\Git\bin' to the path variable as only this folder has sh.exe present.
after adding restart any code GUIs with integrated terminal like VS Code. and tada your issue is resolved.
This! Thank you 馃憤
I didn't want to use git bash and I was about to use ubuntu from the windows store, but then I tried this and it worked in PowerShell!
Can you please invoke the correct executable on Windows?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
On windows there is no 'sh' executable that is why this is giving error.
To resolve this issue include 'C:\Program Files\Git\bin' to the path variable as only this folder has sh.exe present.
after adding restart any code GUIs with integrated terminal like VS Code. and tada your issue is resolved.