bubblewrap init throws -bash: bubblewrap: command not found

626 views Asked by At

I am building a PWA and following this tutorial to create a TWA. npm i -g @bubblewrap/cli runs fine. When I run

bubblewrap init --manifest=http://localhost:8000/static/manifest.webmanifest

or

bubblewrap init --manifest="http://localhost:8000/static/manifest.webmanifest"

or

bubblewrap init --manifest="<http://localhost:8000/static/manifest.webmanifest>"

I get this error:

-bash: bubblewrap: command not found

I have updated npm and bubblewrap based on this post and am still getting the error. My index.html is inside the static directory.

  • node v17.6.0
  • npm v8.5.1
  • java v17
  • jdk v11

Does anyone have advice on why bubblewrap isn't being recognized?

2

There are 2 answers

0
codmitu On

i use npx bubblewrap init --manifest=https://my-website/manifest.json in VSC and it worked (windows10)

0
Hamid Soltani On

I had the same problem. in my case the issue was that when i installed the bubblewrap with npm, it installed it in the v18.12.1 location, but my npm was using another version (in this case v16.16.0). so using the bubblewrap command resulted in the same error as you mentioned. I stumbled upon this question that solved my problem: NVM: npm install -g keeps using wrong version of node

So basically on Ubuntu npm install packages globally using prefix variable that is set in a file called ~/.npmrc. I fixed it with editing ~/.npmrc file, and made sure that prefix points to the correct version.