Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
willgorick opened this issue Jun 3, 2022 · 3 comments
Open

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

willgorick opened this issue Jun 3, 2022 · 3 comments

Comments

@willgorick
Copy link

willgorick commented Jun 3, 2022

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

      - uses: actions/checkout@v2
      - name: Enter serverless dir and deploy
         uses: serverless/[email protected]
         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?

@pmckl
Copy link

pmckl commented Jul 5, 2022

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/[email protected]
         with:
           args: -c "cd ./src/serverless && serverless plugin install --name serverless-plugin-tracing && serverless deploy"
           entrypoint: /bin/sh

@willgorick
Copy link
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

@ryanlawson
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants