question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fails if using pnpm

See original GitHub issue

We are using pnpm (https://pnpm.js.org/) with our project. As such, we do not have a package-lock.json file. Even setting install to false fails with the cypress github action (see below).

Pnpm uses a pnpm-lock.yaml file that serves the same purpose, and generally (though not always) has the same syntax as npm. However, the lockfile formats are not compatible.

This action installs local dependencies using lock files. If yarn.lock file is found, the install uses yarn --frozen-lockfile command. Otherwise it expects to find package-lock.json and install using npm ci command.

internal/fs/utils.js:220
    throw err;
    ^

Error: ENOENT: no such file or directory, open 'package-lock.json'
    at Object.openSync (fs.js:440:3)
    at Object.readFileSync (fs.js:342:35)
    at Function.module.exports.309.hasha.fromFileSync (/home/runner/work/_actions/cypress-io/github-action/v1.16.1/dist/index.js:4439:54)
    at Object.104 (/home/runner/work/_actions/cypress-io/github-action/v1.16.1/dist/index.js:2440:24)
    at __webpack_require__ (/home/runner/work/_actions/cypress-io/github-action/v1.16.1/dist/index.js:22:30)
    at startup (/home/runner/work/_actions/cypress-io/github-action/v1.16.1/dist/index.js:37:19)
    at /home/runner/work/_actions/cypress-io/github-action/v1.16.1/dist/index.js:41:18
    at Object.<anonymous> (/home/runner/work/_actions/cypress-io/github-action/v1.16.1/dist/index.js:44:10)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: 'package-lock.json'
}

If relevant, there is a github action for pnpm: https://github.com/marketplace/actions/setup-pnpm They also have these docs that might be relevant: https://pnpm.js.org/en/continuous-integration

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:20
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

20reactions
tcrwtcommented, Jul 22, 2021

I got stuck on this but running the pnpm install and cypress separately seemed to resolve it. It’s possible this isn’t the best way but it got things working!

- name: Set up pnpm
  uses: pnpm/action-setup@v2.0.1
  with:
    version: 6
    # Only install what we need to run the client in-action and tests against it
    # format:    `--filter <packagename>...`
    run_install: |
      - args: [--filter myclient... --filter cypress-tests...]

- name: Run Cypress tests
  uses: cypress-io/github-action@v2
  with:
    # we have already installed all dependencies above
    install: false
    command: pnpm --dir cypress/ cypress:ci
    start: pnpm --dir myclient/ dev
    wait-on: 'https://localhost:3000'
2reactions
jennifer-shehanecommented, Jun 2, 2020

We would be open to PR to fix this. This would be pretty low priority for us to address ourselves since we have very few pnpm users.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Codes | pnpm
pnpm install will fail if the project has unresolved peer dependencies or the peer dependencies are not matching the wanted ranges. To fix...
Read more >
How to warn or error when using "npm install" - Stack Overflow
pnpm uses pnpm-lock. yaml as its lock file. I was hoping it might be able to write package-lock. json instead for interoperability with...
Read more >
pnpm/pnpm - Gitter
... after using pnpm install? I am getting the following error if I try to debug: node --inspect-brk ./node_modules/.bin/qunit tests/atam-test.js. Error:
Read more >
Switching an NX repo to use PNPM - Medium
PNPM does not hoist all dependencies into your node_modules root, this means if the package.json doesn't reference a dependency that your code require()'s...
Read more >
if you don't want pnpm to fail on peer dependency issues, add ...
You can check the status of the packages by running pnpm ls --json. If you don't want pnpm to fail on peer ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found