Skip to content

Unable to find the gulp binary #138

@tkrotoff

Description

@tkrotoff

I have a structure like this:

[...]/server/app.js
[...]/server/migrations/*.js
[...]/node_modules/gulp
[...]/node_modules/sequelize-cli
[...]/package.json
$ cd server
$ sequelize db:migrate
/node_modules/sequelize-cli/bin/sequelize:19
  throw new Error('Unable to find the `gulp` binary');
        ^
Error: Unable to find the `gulp` binary
    at Object.<anonymous> (/node_modules/sequelize-cli/bin/sequelize:19:9)
    [...]

Debugging https://github.com/sequelize/cli/blob/v1.7.0/bin/sequelize:

  • var gulp = path.resolve(__dirname, '..', 'node_modules', 'gulp', 'bin', 'gulp.js') generates '/node_modules/sequelize-cli/node_modules/gulp/bin/gulp.js' with __dirname being '/node_modules/sequelize-cli/bin'.
  • gulp = path.resolve(process.cwd(), 'node_modules', 'gulp', 'bin', 'gulp.js') generates '/server/node_modules/gulp/bin/gulp.js' with process.cwd() being '/server'.

FYI my PATH contains /node_modules/.bin

Edit: var gulp = path.resolve(__dirname, '..', '..', 'gulp', 'bin', 'gulp.js') works in this case and generates: '/node_modules/gulp/bin/gulp.js'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions