bubblewrap icon indicating copy to clipboard operation
bubblewrap copied to clipboard

bubblewrap init returns command not found

Open Zeesy opened this issue 2 years ago • 8 comments

Describe the bug Running bubblewrap init --manifest=http://localhost:8000/static/manifest.webmanifest results in -bash: bubblewrap: command not found

To Reproduce Steps to reproduce the behavior:

  1. npm i -g @bubblewrap/cli results in
changed 324 packages, and audited 325 packages in 25s
...
found 0 vulnerabilities
  1. bubblewrap init --manifest=http://localhost:8000/static/manifest.webmanifest (or manifest.json. index.html is in /static)
  2. See error -bash: bubblewrap: command not found

Expected behavior Expecting Bubblewrap to start after init command

Desktop (please complete the following information):

  • OS: macOS 11.6.2

Additional context

  • node v17.6.0
  • npm 8.5.1
  • java v17
  • jdk v11

Zeesy avatar Mar 10 '22 17:03 Zeesy

Try these steps:

  1. place the url inside of quotes: bubblewrap init --manifest="http://localhost:8000/static/manifest.webmanifest" (but better place there a manifest.json, as specified in the docs).
  2. open the directory itself - if you don't observe any json output – there's something wrong with your directory.
  3. replace localhost by your local IP address (usually looks like something like this: 192.168.0.09.) or better by ngrok or surge. Where to find on MacOS: System Configuration --> Network
image

LupusX5 avatar Mar 23 '22 19:03 LupusX5

Thanks for your reply. Using quotes doesn't produce any new json files in the /static directory. Is that what you mean by json output? There is no new info for bubblewrap in the manifest.json after running it either. Replacing localhost with the local IP address results in the same bash error. What could be wrong with the directory?

Zeesy avatar Mar 23 '22 23:03 Zeesy

It seems the problem is related to bash being unable to find the binary instead. Maybe something like this: https://stackoverflow.com/questions/70999596/node-and-npm-not-found-after-restarting-macos

andreban avatar Mar 24 '22 17:03 andreban

I am also hitting this same error. bubblewrap -h and bubblewrap init both return zsh: command not found: bubblewrap. The stackoverflow linked above does not solve this issue either; node -v and npm commands work fine for me.

(My node version is v18.12.0 and I am on MacOS.)

skedwards88 avatar Dec 29 '22 16:12 skedwards88

It seems like Node failed to simlink files - would you mind providing more context on how Node is installed? (eg: via Homebrew, NVM, etc?)

andreban avatar Jan 13 '23 23:01 andreban

having the same error. In my case I use node 18.13.0 and MacOS with apple silicon M1 chip. My node version is installed via NVM. I've tried both with npm and pnpm and I have the same result. Also if I use npx bubblewrap init --manifest=https://some-url-here/manifest.json I get this error:

npm ERR! could not determine executable to run

pedro199288 avatar Apr 24 '23 16:04 pedro199288

In my case it worked but got:

? Domain: (localhost:8000) localhost:8000
>> Invalid URL: localhost:8000

tomasdev avatar Nov 02 '23 04:11 tomasdev

In case it helps. I was also experimenting with a local PWA. Manifest from http://localhost:8000 was no problem. Then I ran into the domain issue as well. I just populated it with https://127.0.0.1 (it also complained about needing to be HTTPS).

Don't build it yet. Instead go to app/build.gradle and update the twaManifest definition, there should be a parameter hostName containing the 127.0.0.1 - change it to localhost and port if needed i.e. localhost:8000

Then serach for "launchUrl" and change the protocol from https:// to http:// (if needed).

I was then able to run bubblewrap build and my local PWA seems to work fine that way.

tbabik avatar Dec 18 '23 16:12 tbabik