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

install from npm does not build browser version #346

Open
risacher opened this issue Sep 8, 2023 · 7 comments
Open

install from npm does not build browser version #346

risacher opened this issue Sep 8, 2023 · 7 comments

Comments

@risacher
Copy link

risacher commented Sep 8, 2023

if I use 'npm install -s qrcode' there is no build subdirectory, but if I do 'npm install -s soldair/node-qrcode' there is.

@javajosh
Copy link

I had the same issue, but your tip worked. Thanks!

@arethk
Copy link

arethk commented Sep 27, 2023

Same issue when you do "npm install --save qrcode" as the docs state.

Works when you do "npm install -s soldair/node-qrcode", as stated above but you get this in your package.json: "qrcode": "github:soldair/node-qrcode". I don't think that's ideal.

@joshuatshaffer
Copy link

The build directory is present in version 1.5.1 but not in 1.5.2 and 1.5.3. I'm guessing there was a mistake when publishing to npm.

The following worked for me:
npm install --save qrcode@1.5.1

<canvas id="canvas"></canvas>

<script src="./node_modules/qrcode/build/qrcode.js"></script>
<script>
  QRCode.toCanvas(
    document.getElementById("canvas"),
    "sample text",
    function (error) {
      if (error) console.error(error);
      console.log("success!");
    }
  );
</script>

@salixh5
Copy link

salixh5 commented Oct 14, 2023

Great, I'm using v1.5.1 for now.

@dolanmiu
Copy link

The path now as of 1.5.3 seems to be: node_modules\qrcode\lib\browser.js

Try this instead

@bikubi
Copy link

bikubi commented Dec 15, 2023

The path now as of 1.5.3 seems to be: node_modules\qrcode\lib\browser.js

Try this instead

don't! @dolanmiu it's not the same; lib/browser.js is not built in any way, e.g. it contains requires.

@tomchiverton
Copy link

Workaround WFM too

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

8 participants