i'm trying to bundle up my javascript object to run main.js on browser so i used browserify steps:-
1- npm install -g browserify
2- write javascript code and save it to main.js
var ocrSpaceApi = require('ocr-space-api-alt2')
const options = {
apikey: '',
filetype: 'png',
verbose: true,
url: `${__dirname}/Uff.png`
}
const getText = async () => {
try {
const result = await ocrSpaceApi(options)
console.log({ result })
} catch (error) {
console.error(error)
}
}
getText()
3- installing ocr-space-api-alt2
npm install ocr-space-api-alt2 also tried npm i ocr-space-api-alt2
at least bundle up using the command
browserify main.js -o bundle.js
but when i use the command to bundle the project i get this Error :-
Error: Can't walk dependency graph: Cannot find module 'ocr-space-api-alt2' from 'C:\xampp\htdocs\browser\main.js' required by C:\xampp\htdocs\browser\main.js