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.

"Error: Error: Failed to load the 'package.json' file, did you setup your project correctly?"

See original GitHub issue

Bug Report

Current behavior

Running action in GitHub, get error that can’t load package.json.

Expected behavior

Package.json is loaded

Others: Action:

on:
  pull_request:
    branches: [develop]

jobs:
  lint_and_build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout Repo
        uses: actions/checkout@v2

      - name: Directory change
        run: |
          cd <nx_directory>

      - name: Nrwl Nx
        uses: MansaGroup/nrwl-nx-action@v2.0.3
        with:
          targets: lint, build

Output:

Run MansaGroup/nrwl-nx-action@v2.0.3 🔍 Ensuring Nx is available Error: Error: Failed to load the ‘package.json’ file, did you setup your project correctly?

I put a pwd and ls in the Directory Change step to ensure I was in the right place, the output included the proper package.json file.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
IamBlueSlimecommented, Jun 10, 2021

It works at the latest HEAD if you regenerate the dist/index.js file with npm run package.

Looks like a new release build just needs to be made to fix this.

I’ll create a new release then! Thanks for pointing out!

0reactions
jacewardellcommented, Nov 4, 2021

Thanks for the quick reply! That makes sense. So it seems like I’ll have to do my npm ci in each job too, which at that point, it seems best to just have everything together in one job.

Read more comments on GitHub >

github_iconTop Results From Across the Web

In VS Code, I'm getting this error, 'Failed to load module ...
It seems like some path is broken on my machine or something is missing. We have a package.json with a script to run...
Read more >
Solved: CLD200 - Manual Deployment keeps erroring out
Solved: I am going through the CLD200 documentation stepwise and building the sample application. It has been working properly, until I get to...
Read more >
Configuring your application's dependencies - AWS Elastic ...
When your application runs, Node.js loads the modules from this directory. ... You can specify these module dependencies using a package.json file.
Read more >
package.json - npm Docs
This document is all you need to know about what's required in your package.json file. It must be actual JSON, not just a...
Read more >
Error Codes | Yarn - Package Manager
The author of packageA can fix this problem by adding a peer dependency on packagePeer . If relevant, they can use optional 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