danger / danger/danger-js

Getting error when running danger locally

Open
#636 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5.5k
Forks
381
Avg merge
2h 8m
Merged PRs (30d)
6

Description

# Problem
Danger is locally crashing for me with following setup:

```shell
Now using node v8.4.0 (npm v5.3.0)
Found '/Users/ashkinas/src/metaphysics/.nvmrc' with version
N/A version is not installed yet

> husky - npm run -s prepush
> husky - node v5.10.1

yarn run v1.1.0
$ "/Users/ashkinas/src/metaphysics/node_modules/.bin/danger" "local"
/Users/ashkinas/src/metaphysics/node_modules/parse-diff/index.js:120
ref = current.changes, [recentChange] = slice.call(ref, -1);
^^^^^^^^^^^^^^

ReferenceError: Invalid left-hand side in assignment
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object. (/Users/ashkinas/src/metaphysics/node_modules/danger/distribution/platforms/git/diffToGitJSONDSL.js:3:17)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

> husky - pre-push hook failed (add --no-verify to bypass)
> husky - to debug, use 'npm run prepush'
error: failed to push some refs to 'git@github.com:ashkan18/metaphysics.git'
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the local Danger run with the reported Node versions and inspect node_modules/parse-diff/index.js around line 120, then trace its use from distribution/platforms/git/diffToGitJSONDSL.js. Confirm which supported runtime or dependency behavior causes the syntax failure, and consider the issue done when the reported local run completes without this crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.