jsmrcaga / action-netlify-deploy

MIT License
104 stars 32 forks source link

package.json is required to work #40

Closed crisperit closed 1 year ago

crisperit commented 1 year ago

When running that plugin without package.json - the following error is being throwed (I've set default build command to echo skip and disabled nvm usage)

pm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated statsd-client@0.4.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.

added 1428 packages, and audited 1429 packages in 45s

187 packages are looking for funding
  run `npm fund` for details

18 vulnerabilities (1 low, 10 moderate, 7 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /github/workspace/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/github/workspace/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

After adding the package.json this is solved - but shall it really be required if I just want to push already built web ?

I think it would be good idea to use docker image with already preinstalled netlify-cli like https://hub.docker.com/r/williamjackson/netlify-cli (which also might reduce action work time). The issue with package.json is maybe throwed because it tries to install netlify-cli

jsmrcaga commented 1 year ago

Hi @crisperit ! You are absolutely right, we shouldn't need a package.json to install netlify-cli.

Your issue actually references an issue I opened a while ago, GitHub pre-installs these cli tools on their ubuntu-latest distribtions (maybe macos and windows too?): https://github.com/jsmrcaga/action-netlify-deploy/issues/35 . Sadly I haven't taken the time to test it out.

Would you be willing to fork this repo and give that a try? It might mean migrating away from docker-actions and just creating a composite action though

crisperit commented 1 year ago

OK, I can give a try

jsmrcaga commented 1 year ago

Thanks @crisperit ! Let me know how it goes!

crisperit commented 1 year ago

I've posted the PR buut mine issue with package.json is required was resolved differently - via passing:

          use_nvm: false
          install_command: "echo skip installing dependencies"
duckfromdiscord commented 1 year ago

still having this issue

duckfromdiscord commented 1 year ago

Any fix? 🙂