Skip to content

Example in README not working #2

@tlylt

Description

@tlylt

Hi there!

I'm trying out the example given in the README, with slight modifications to use the latest actions/checkout and actions/setup-node

name: "Danger TS"

on: pull_request

permissions:
  actions: write
  checks: write
  contents: write
  issues: write
  pull-requests: write
  statuses: write

jobs:
  danger:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
      - name: "Use npx to run the dangerfile"
        run: "npx danger-ts"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The result is a CI run failure:

Run npx danger-ts
npm WARN exec The following package was not found and will be installed: [email protected]
node:internal/modules/cjs/loader:998
  throw err;
  ^

Error: Cannot find module '/home/runner/.npm/_npx/d1[7](https://github.com/tlylt/danger-demo/actions/runs/4201699300/jobs/7288964524#step:4:8)13d9723[8](https://github.com/tlylt/danger-demo/actions/runs/4201699300/jobs/7288964524#step:4:9)8ceec/node_modules/lib/node_modules/danger-ts/node_modules/danger/distribution/commands/danger-runner.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:[9](https://github.com/tlylt/danger-demo/actions/runs/4201699300/jobs/7288964524#step:4:10)95:15)
    at Function.Module._load (node:internal/modules/cjs/loader:841:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:[12](https://github.com/tlylt/danger-demo/actions/runs/4201699300/jobs/7288964524#step:4:13))
    at node:internal/main/run_main_module:22:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

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