Problems with using npm to install/import the library.
See original GitHub issueDescribe the bug I tried to use the library through npm and have found a few issues.
To Reproduce Steps to reproduce the behavior:
- import
npm i html5-qrcode
- Try importing the library like
import Html5QrcodeScanner from 'html5-qrcode'
- Get a module not found error
- Change import to
import Html5QrcodeScanner from 'html5-qrcode/minified/html5-qrcode.min'
- Get a module build failure
Expected behavior
import Html5QrcodeScanner from 'html5-qrcode'
or at least giving the specific path inside the module should work.
Additional context
The first error is likely due to the main property of the package.json being set to "html5-qrcode.js"
which does not exist.
The minified file I tried to import is the only java script file that is inside the folder in node_modules.
Here’s also a screenshot of the build failure:
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:13 (4 by maintainers)
Top Results From Across the Web
NPM doesn't install module dependencies - Stack Overflow
I had an issue where manually installing a package had created a package-lock.json file after updating to node 8.0.0 and npm 5.0.0. After...
Read more >Common errors | npm Docs
Some strange issues can be resolved by simply running npm cache clean and trying again. If you are having trouble with npm install...
Read more >How to Solve the Global npm Module Dependency Problem
The first thing you need to do is remove that -g when you install modules. You should replace that with --save-dev so you...
Read more >How To Use Node.js Modules with npm and package.json
Use `npm install <pkg>` afterwards to install a package and save it as a dependency in the package.json file. Press ^C at any...
Read more >Manage npm packages - Visual Studio (Windows)
To help identify errors, check the npm Output window when installing the packages, as described previously in this article. For example, if one ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any update on this @mebjas ?
@Vincz You can try this to manually import the source code into your project:
@mebjas I have submitted a PR, please check.