jeremyzahner/shipit-composer

Path error

lucidlemon opened this issue · 3 comments

I can't use this package, getting:

'composer:init' errored after 512 μs
TypeError: Path must be a string. Received undefined
    at assertPath (path.js:8:11)
    at Object.posix.join (path.js:479:5)
    at Shipit.task (/Developer/cobalt-blueprint/node_modules/shipit-composer/tasks/composer/init.js:24:51)
    at module.exports (/Users/danielwinter/.nvm/versions/node/v5.0.0/lib/node_modules/shipit-cli/node_modules/orchestrator/lib/runTask.js:34:7)
    at Shipit.Orchestrator._runTask (/Users/danielwinter/.nvm/versions/node/v5.0.0/lib/node_modules/shipit-cli/node_modules/orchestrator/index.js:273:3)
    at Shipit.Orchestrator._runStep (/Users/danielwinter/.nvm/versions/node/v5.0.0/lib/node_modules/shipit-cli/node_modules/orchestrator/index.js:214:10)
    at /Users/danielwinter/.nvm/versions/node/v5.0.0/lib/node_modules/shipit-cli/node_modules/orchestrator/index.js:279:18
    at finish (/Users/danielwinter/.nvm/versions/node/v5.0.0/lib/node_modules/shipit-cli/node_modules/orchestrator/lib/runTask.js:21:8)
    at module.exports (/Users/danielwinter/.nvm/versions/node/v5.0.0/lib/node_modules/shipit-cli/node_modules/orchestrator/lib/runTask.js:60:3)
    at Shipit.Orchestrator._runTask (/Users/danielwinter/.nvm/versions/node/v5.0.0/lib/node_modules/shipit-cli/node_modules/orchestrator/index.js:273:3)
    at Shipit.Orchestrator._runStep (/Users/danielwinter/.nvm/versions/node/v5.0.0/lib/node_modules/shipit-cli/node_modules/orchestrator/index.js:214:10)
    at Shipit.Orchestrator.start (/Users/danielwinter/.nvm/versions/node/v5.0.0/lib/node_modules/shipit-cli/node_modules/orchestrator/index.js:134:8)
    at initShipit (/Users/danielwinter/.nvm/versions/node/v5.0.0/lib/node_modules/shipit-cli/bin/shipit:81:10)
    at Liftoff.invoke (/Users/danielwinter/.nvm/versions/node/v5.0.0/lib/node_modules/shipit-cli/bin/shipit:55:5)
    at Liftoff.<anonymous> (/Users/danielwinter/.nvm/versions/node/v5.0.0/lib/node_modules/shipit-cli/node_modules/liftoff/index.js:192:16)
    at module.exports (/Users/danielwinter/.nvm/versions/node/v5.0.0/lib/node_modules/shipit-cli/node_modules/flagged-respawn/index.js:17:3)
    at Liftoff.<anonymous> (/Users/danielwinter/.nvm/versions/node/v5.0.0/lib/node_modules/shipit-cli/node_modules/liftoff/index.js:185:9)
    at /Users/danielwinter/.nvm/versions/node/v5.0.0/lib/node_modules/shipit-cli/node_modules/liftoff/index.js:159:9
    at /Users/danielwinter/.nvm/versions/node/v5.0.0/lib/node_modules/shipit-cli/node_modules/v8flags/index.js:108:14
    at /Users/danielwinter/.nvm/versions/node/v5.0.0/lib/node_modules/shipit-cli/node_modules/v8flags/index.js:36:12
    at /Users/danielwinter/.nvm/versions/node/v5.0.0/lib/node_modules/shipit-cli/node_modules/v8flags/index.js:47:7
    at doNTCallback0 (node.js:428:9)
Path must be a string. Received undefined

shipitfile is:

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

    shipit.initConfig({
        default: {
            workspace: '/tmp/github-monitor',
            deployTo: '/var/www/xxx',
            repositoryUrl: 'bestGitPathInThisWorld
            ignores: ['.git', 'node_modules'],
            keepReleases: 5,
            deleteOnRollback: false,
            key: '~/.ssh/id_rsa',
            shallowClone: true,
            composer: {
                remote: true,
                installFlags: ['--no-dev', '--prefer-stable'],
                composerFile: '/usr/local/bin/composer'
            }
        },
        beta: {
            servers: 'deploy@xxx.xxx',
            branch: 'master'
        }
    });

};

Hi @lucidlemon

Seems like this is related to missing path2.

Try requiring path2 instead of path.

@lucidlemon Feel free to reopen this issue if the problem persisted!

Consider use "composerCommand" in parameters example

composer: {
remote: true,
composerCommand: '/usr/local/bin/composer',
}