Reputation: 81
I have to a requirement of uploading an image and fetching the text written in that image in text format. The image will be of a business card which i will get from the mobile app. I have do it using node js. I tried using ocr npm but i am getting error while installing ocr as dependency, i.e.
$ npm install ocr
> [email protected] install E:\node_modules\ref
> node-gyp rebuild
E:\node_modules\ref>if not defined npm_config_node_gyp (node
"C:\Users\Hello\AppData\Roaming\npm\node_modules\npm\node_modules\npm-
lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
) else (node
"C:\Users\Hello\AppData\Roaming\npm\node_modules\npm\node_modules\node-
gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel
build, please add the "/m" switch.
E:\node_modules\ref\build\binding.vcxproj(20,3): error MSB4019: The imported
project "E:\Microsoft.Cpp.Default.props" was not found. Confirm that the
path in the <Import> declaration is correct, and that the file exists on
disk.
gyp ERR! build error
gyp ERR! stack Error:
`C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit
code: 1
gyp ERR! stack at ChildProcess.onExit
(C:\Users\Hello\AppData\Roaming\npm\node_modules\npm\node_modules\node-
gyp\lib\build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit
(internal/child_process.js:198:12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe"
"C:\\Users\\Hello\\AppData\\Roaming\\npm\\node_modules
\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd E:\node_modules\ref
gyp ERR! node -v v8.9.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional
logging output above.
Is there any way to fix this issue or any other node module which i can use to read text from image?
Upvotes: 1
Views: 350
Reputation: 182
I was facing the same error while installing ocr in Ubuntu. According to me, It is OS specific error. When I tried to install ocr in MAC OS using "npm i ocr", It is installed successfully. So you can try this.
Upvotes: 1