Skip to content

danger pr throwing "Cannot find module 'package.json'" #261

@kanaabe

Description

@kanaabe

👋 I'm currently trying to add danger to my project. I've set up my dangerfile.js as so:

const { danger, fail } = require('danger')

const someoneAssigned = danger.github.pr.assignee
if (someoneAssigned === null) {
  fail("Please assign someone to merge this PR, and optionally include people who should review.")
}

and if I run danger pr I get back an error:

> danger pr https://github.com/artsy/positron/pull/1
(node:97283) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: Cannot find module 'package.json'
(node:97283) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I have danger installed both globally and to my project repo. My local version of Node is v7.10.0. Any thoughts?

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