question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: spawn /bin/sh ENOENT

See original GitHub issue

Hi,

I’m using shipit in my projects and it worked well. However, I’ve faced with strange issue and I don’t know how to fix it. I’m trying to deploy project from git repository:

$ shipit dev deploy
Running 'deploy:init' task...
Finished 'deploy:init' after 1.33 ms
Running 'deploy:fetch' task...
Create workspace...
Workspace created: "/tmp/app"
Initialize local repository in "/tmp/app"
Running "git init" on local.
'deploy:fetch' errored after 14 ms
Error: spawn /bin/sh ENOENT
    at _errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

Here is my config:

var path = require('path');

module.exports = function (shipit) {
    require('shipit-deploy')(shipit);
    require('shipit-shared')(shipit);

    shipit.initConfig({
        default: {
            workspace: '/tmp/app',
            dirToCopy: '/tmp/app/www',
            deployTo: '/var/www/public_html/app.net/www',
            repositoryUrl: 'https://user@bitbucket.org/user/app.git',
            branch: 'master',
            ignores: ['.git', 'node_modules'],
            rsync: ['--del'],
            keepReleases: 3,
            deleteOnRollback: false,
            key: '~/.ssh/id_rsa',
            shallowClone: false,
            shared: {
                overwrite: true,
                dirs: [
                    { path: 'public/photos', overwrite: true, chmod: '-R 755' }
                ]
            }
        },
        dev: {
            servers: 'user@192.168.1.5:22',
            branch: 'develop'
        },
        production: {
            servers: 'user@app.net:22',
            branch: 'master'
        }
    });

    shipit.on('deployed', function () {
        shipit.start(['run']);
    });

    shipit.blTask('run', function () {
        shipit.start('pm2:start');
    });

    shipit.blTask('pm2:start', function () {
        return shipit.remote('source ~/.nvm/nvm.sh && pm2 start ' + shipit.currentPath + '/process.json');
    });
};

Previously everything worked good.

$ shipit --version
4.0.2

Please help me to fix this issue.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:17 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
RichAyottecommented, Jun 5, 2018

Here’s the problem. The config.workspace is ignored when shallowClone is true and some scripts depend on that path.

https://github.com/shipitjs/shipit/blob/343fa7dfb41f507492eca315ceda52eaa1e6d703/packages/shipit-deploy/src/tasks/deploy/fetch.js#L24

if (shipit.config.shallowClone) {
  const tmpDir = await tmp.dir()
  shipit.workspace = tmpDir.path
} else {
  shipit.workspace = shipit.config.workspace
  if (path.resolve(shipit.workspace) === process.cwd()) {
    throw new Error('Workspace should be a temporary directory')
  }
}
1reaction
gregbergecommented, Apr 2, 2018

Thanks for investigated it, so it is a bug in v4. Will try to find it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node Error spawn /bin/sh ENOENT on remote server
Okay, I am an idiot. The folder on my local machine is named differently from the git repo and therefore the folder on...
Read more >
Error: spawnSync /bin/sh ENOENT · Issue #9644 · nodejs/node
I encounter the same error message in a Debian server, and it was due to a typo in cwd option pass to exec:...
Read more >
Debugging Node's spawn ENOENT - Ethan Mick
Turns out, this error means something doesn't exist, not /bin/sh . It turns out that the cwd I was setting the command to...
Read more >
Error: spawn node_modules/webpack/bin/webpack.js ENOENT
Hi I am in windows 10 when I issue the command npm run dev. it shows error. Error: spawn node_modules/webpack/bin/webpack.js ENOENT.
Read more >
How to solve spawn bin/zsh ENOENT? - Unix Stack Exchange
I am installing dependencies for a project using NodeJS, Angular and Node-Sass, all goes ok when installing both Node and Angular, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found