yarn cannot find js-yaml

Viewed 153

I'm running yarn in a Github workflow and it cannot find js-yaml. The dependency is in my package.json and yarn.lock. I tried explicitly adding it before running yarn. I tried a number of variations such as

yarn install
yarn add js-yaml

the log output looks like it finds the module but then I get Module not found when my javascript starts:

yarn add v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 2 new dependencies.
info Direct dependencies
└─ js-yaml@4.1.0
info All dependencies
├─ argparse@2.0.1
└─ js-yaml@4.1.0
Done in 4.66s.
yarn install v1.22.17
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.13s.
internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module 'js-yaml'
Require stack:
- /home/runner/work/legible/legible/.github/workflows/per_stack_setup/per_stack_env_init.js

Due to other constraints my workflow code summarizes as follows:

    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Use Node.js
        uses: actions/setup-node@v1
        with:
          node-version: 14.x

      - name: per stack setup
        working-directory: scripts
        run: |
          yarn add js-yaml --ignore-workspace-root-check
          yarn install
          node ../.github/workflows/per_stack_setup/per_stack_env_init.js
0 Answers
Related