安装tesseract.js

时间:2019-05-29 22:08:12

标签: node.js npm tesseract

无法通过npm i -G tesseract安装tesseract.js

Windows 10,npm版本6.8.0

错误:

  

!   C:\ WINDOWS \ system32 \ node_modules \ tesseract>如果未定义npm_config_node_gyp(节点“ C:\ Users \ andre \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ npm-lifecycle \ node-gyp-bin \ ... 。\ node_modules \ node-gyp \ bin \ node-gyp.js“ rebuild)else(节点” C:\ Users \ andre \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ node-gyp \ bin \ node-gyp .js“重建)   MSBUILD:错误MSB1009:项目文件不存在。   Ключ:build / binding.sln   糟糕!建立错误   糟糕!堆栈错误:C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe失败,退出代码:1   糟糕!堆栈在ChildProcess.onExit(C:\ Users \ andre \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ node-gyp \ lib \ build.js:262:23)   糟糕!堆栈在ChildProcess.emit(events.js:189:13)   糟糕!堆栈位于Process.ChildProcess._handle.onexit(internal / child_process.js:248:12)   糟糕!系统Windows_NT 10.0.17763   糟糕!命令“ C:\ Program Files \ nodejs \ node.exe”“ C:\ Users \ andre \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ node-gyp \ bin \ node-gyp.js”“重建”   糟糕! CWD C:\ WINDOWS \ system32 \ node_modules \ tesseract   糟糕!节点-v v10.15.3   糟糕!节点gyp -v v3.8.0   糟糕!不好   npm WARN ENTENT ENOENT:没有此类文件或目录,请打开“ C:\ WINDOWS \ system32 \ package.json”   npm WARN system32没有描述   npm WARN system32没有存储库字段。   npm WARN system32没有自述数据   npm WARN system32没有许可证字段。   npm ERR!代码ELIFECYCLE   npm ERR! errno 1   npm ERR! tesseract@0.0.3安装:node-gyp rebuild   npm ERR!退出状态1   npm ERR!   npm ERR! tesseract@0.0.3安装脚本失败。   npm ERR! npm可能不是问题。上面可能还有其他日志记录输出。   npm ERR!可以在以下位置找到此运行的完整日志:   npm ERR! C:\ Users \ andre \ AppData \ Roaming \ npm-cache_logs \ 2019-05-29T21_46_48_037Z-debug.log

日志文件

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\andre\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'i',
1 verbose cli   '-G',
1 verbose cli   'tesseract' ]
2 info using npm@6.8.0
3 info using node@v10.15.3
4 verbose npm-session 30233da101cd2793
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 304 https://registry.npmjs.org/tesseract 315ms (from cache)
8 silly pacote tag manifest for tesseract@latest fetched in 327ms
9 timing stage:loadCurrentTree Completed in 344ms
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
13 silly install loadShrinkwrap
14 timing stage:loadIdealTree:loadShrinkwrap Completed in 0ms
15 silly install loadAllDepsIntoIdealTree
16 silly resolveWithNewModule tesseract@0.0.3 checking installable status
17 timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 4ms
18 timing stage:loadIdealTree Completed in 6ms
19 silly currentTree system32
20 silly idealTree system32
20 silly idealTree `-- tesseract@0.0.3
21 silly install generateActionsToTake
22 timing stage:generateActionsToTake Completed in 3ms
23 silly diffTrees action count 1
24 silly diffTrees add tesseract@0.0.3
25 silly decomposeActions action count 8
26 silly decomposeActions fetch tesseract@0.0.3
27 silly decomposeActions extract tesseract@0.0.3
28 silly decomposeActions preinstall tesseract@0.0.3
29 silly decomposeActions build tesseract@0.0.3
30 silly decomposeActions install tesseract@0.0.3
31 silly decomposeActions postinstall tesseract@0.0.3
32 silly decomposeActions finalize tesseract@0.0.3
33 silly decomposeActions refresh-package-json tesseract@0.0.3
34 silly install executeActions
35 silly doSerial global-install 8
36 verbose correctMkdir C:\Users\andre\AppData\Roaming\npm-cache\_locks correctMkdir not in flight; initializing
37 verbose lock using C:\Users\andre\AppData\Roaming\npm-cache\_locks\staging-3abc070f8384e01a.lock for C:\WINDOWS\system32\node_modules\.staging
38 silly doParallel extract 1
39 silly extract tesseract@0.0.3
40 silly tarball trying tesseract@latest by hash: sha1-/0udBb/uDZDT2TRQ6MZgaVT/Niw=
41 silly extract tesseract@latest extracted to C:\WINDOWS\system32\node_modules\.staging\tesseract-314a17f0 (25ms)
42 timing action:extract Completed in 26ms
43 silly doReverseSerial unbuild 8
44 silly doSerial remove 8
45 silly doSerial move 8
46 silly doSerial finalize 8
47 silly finalize C:\WINDOWS\system32\node_modules\tesseract
48 timing action:finalize Completed in 4ms
49 silly doParallel refresh-package-json 1
50 silly refresh-package-json C:\WINDOWS\system32\node_modules\tesseract
51 timing action:refresh-package-json Completed in 14ms
52 silly doParallel preinstall 1
53 silly preinstall tesseract@0.0.3
54 info lifecycle tesseract@0.0.3~preinstall: tesseract@0.0.3
55 timing action:preinstall Completed in 1ms
56 silly doSerial build 8
57 silly build tesseract@0.0.3
58 info linkStuff tesseract@0.0.3
59 silly linkStuff tesseract@0.0.3 has C:\WINDOWS\system32\node_modules as its parent node_modules
60 timing action:build Completed in 1ms
61 silly doSerial global-link 8
62 silly doParallel update-linked 0
63 silly doSerial install 8
64 silly install tesseract@0.0.3
65 info lifecycle tesseract@0.0.3~install: tesseract@0.0.3
66 verbose lifecycle tesseract@0.0.3~install: unsafe-perm in lifecycle true
67 verbose lifecycle tesseract@0.0.3~install: PATH: C:\Users\andre\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\WINDOWS\system32\node_modules\tesseract\node_modules\.bin;C:\WINDOWS\system32\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Git\cmd;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\PuTTY\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Yarn\bin\;C:\Program Files\nodejs\;C:\Users\andre\.windows-build-tools\python27\;C:\Users\andre\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\andre\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\.bin;C:\Users\andre\AppData\Roaming\npm\node_modules\.bin;C:\Users\andre\AppData\Local\Microsoft\WindowsApps;C:\Program Files\heroku\bin;C:\Python27;C:\Python27\Scripts;C:\Users\andre\AppData\Local\Yarn\bin;C:\Users\andre\AppData\Roaming\npm
68 verbose lifecycle tesseract@0.0.3~install: CWD: C:\WINDOWS\system32\node_modules\tesseract
69 silly lifecycle tesseract@0.0.3~install: Args: [ '/d /s /c', 'node-gyp rebuild' ]
70 timing audit submit Completed in 310ms
71 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 310ms
72 timing audit body Completed in 1ms
73 silly lifecycle tesseract@0.0.3~install: Returned: code: 1  signal: null
74 info lifecycle tesseract@0.0.3~install: Failed to exec install script
75 timing action:install Completed in 941ms
76 verbose unlock done using C:\Users\andre\AppData\Roaming\npm-cache\_locks\staging-3abc070f8384e01a.lock for C:\WINDOWS\system32\node_modules\.staging
77 timing stage:rollbackFailedOptional Completed in 7ms
78 timing stage:runTopLevelLifecycles Completed in 1358ms
79 silly saveTree system32
79 silly saveTree `-- tesseract@0.0.3
80 warn enoent ENOENT: no such file or directory, open 'C:\WINDOWS\system32\package.json'
81 verbose enoent This is related to npm not being able to find a file.
82 warn system32 No description
83 warn system32 No repository field.
84 warn system32 No README data
85 warn system32 No license field.
86 verbose stack Error: tesseract@0.0.3 install: `node-gyp rebuild`
86 verbose stack Exit status 1
86 verbose stack     at EventEmitter.<anonymous> (C:\Users\andre\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
86 verbose stack     at EventEmitter.emit (events.js:189:13)
86 verbose stack     at ChildProcess.<anonymous> (C:\Users\andre\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
86 verbose stack     at ChildProcess.emit (events.js:189:13)
86 verbose stack     at maybeClose (internal/child_process.js:970:16)
86 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
87 verbose pkgid tesseract@0.0.3
88 verbose cwd C:\WINDOWS\system32
89 verbose Windows_NT 10.0.17763
90 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\andre\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "i" "-G" "tesseract"
91 verbose node v10.15.3
92 verbose npm  v6.8.0
93 error code ELIFECYCLE
94 error errno 1
95 error tesseract@0.0.3 install: `node-gyp rebuild`
95 error Exit status 1
96 error Failed at the tesseract@0.0.3 install script.
96 error This is probably not a problem with npm. There is likely additional logging output above.
97 verbose exit [ 1, true ]

1 个答案:

答案 0 :(得分:0)

要安装tesseract.js,您应该输入:

$ npm i tesseract.js # https://www.npmjs.com/package/tesseract.js

代替

$ npm i tesseract    # https://www.npmjs.com/package/tesseract

它们是非常不同的软件包,后来已经停止维护了将近4年。如果仍然要使用它,请尝试在此处留下一个问题:https://github.com/7eggs/node-tesseract