Skip to content

No such file or directory 'package.json' #69

Description

@willgorick

I have the following steps in my github action .yml file:

      - uses: actions/checkout@v2
      - name: Enter serverless dir and deploy
         uses: serverless/github-action@v3.1
         with:
           args: -c "cd ./src/serverless && serverless plugin install --name serverless-plugin-tracing && serverless deploy"
           entrypoint: /bin/sh

But I'm getting an error, despite the fact that I do have a package.json file in my src/serverless folder:
npm ERR! enoent ENOENT: no such file or directory, open '/github/home/.npm/_cacache/tmp/jrJNSF/package.json'

Does anyone know of a workaround/solution for this?

Activity

  1. pmckl commented on Jul 5, 2022

    @pmckl

    The indent is wrong in you example, the entrypoint should be in the same level as args:

          - uses: actions/checkout@v2
          - name: Enter serverless dir and deploy
             uses: serverless/github-action@v3.1
             with:
               args: -c "cd ./src/serverless && serverless plugin install --name serverless-plugin-tracing && serverless deploy"
               entrypoint: /bin/sh
  2. willgorick commented on Jul 5, 2022

    @willgorick
    Author

    Sorry that was just a copy pasting mistake, the indentation of the entrypoint line is the same as args in my actual repo. I've updated my original comment to reflect this

  3. ryanlawson commented on May 18, 2024

    @ryanlawson

    Created #90 to allow changing working directory and installing packages, should provide a cleaner way to accomplish this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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