我需要对使用Nativescript开发的移动应用程序进行OCR识别。
我安装了ocr-space-api软件包,但是当我尝试运行应用程序时,最初它无法找到插件文件中所需的模块“fs”。
如果我编辑ocrSpaceApi.js文件第3行:从
更改const fs = require('fs');
为:
const fs = require('file-system');
然后它过去了,但后来我得到了这个错误:
app / tns_modules / tough-cookie / lib / cookie.js:32:18:JS ERROR错误: 无法找到模块'net'。
以下是我的package.json
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "org.nativescript.testingapp",
"tns-ios": {
"version": "3.4.1"
}
},
"dependencies": {
"@angular/animations": "~5.2.0",
"@angular/common": "~5.2.0",
"@angular/compiler": "~5.2.0",
"@angular/core": "~5.2.0",
"@angular/forms": "~5.2.0",
"@angular/http": "~5.2.0",
"@angular/platform-browser": "~5.2.0",
"@angular/platform-browser-dynamic": "~5.2.0",
"@angular/router": "~5.2.0",
"email-validator": "^1.1.1",
"nativescript-angular": "~5.2.0",
"nativescript-camera": "^4.0.1",
"nativescript-iqkeyboardmanager": "^1.3.0",
"nativescript-theme-core": "~1.0.4",
"ocr-space-api": "^1.0.1",
"reflect-metadata": "~0.1.8",
"rxjs": "~5.5.2",
"tns-core-modules": "~3.4.0",
"zone.js": "~0.8.18"
},
"devDependencies": {
"nativescript-dev-typescript": "~0.6.0",
"typescript": "~2.6.2"
}
}
有人可以建议如何正确运行吗? 我要说编辑ocrSpaceApi.js文件不是最好的。
是否存在与正在使用的其他插件的兼容性问题。
我正在为应用的其他部分使用以下其他插件: nativescript-iqkeyboardmanager 电子邮件验证 nativescript相机