Как установить npm модуль вручную
-
Добрый день. Искал на форуме, но не нашел нужного ответа.
Пытаюсь установить npm модуль Tesseract.js, пробовал через настройки Bas добавить модуль, он перезагружается и пытается его загрузить, но выдает ошибку: "Не удалось установить npm модули"
В текстовом файле node_log пишет следующее:[15:16:45.963] ------------------------------------------------------------------ [15:16:45.974] Starting Node.js 12.18.3 [15:16:45.990] Installed distr not found [15:16:46.5] Hash 38c8 [15:16:46.21] Suffix I22A [15:16:46.31] Found cache C:/Users/Sergey/AppData/Roaming/BrowserAutomationStudio/apps/23.1.1/e/cache.node.12.18.3.zip [15:16:46.44] Extracting to folder C:/Users/Sergey/AppData/Roaming/BrowserAutomationStudio/apps/23.1.1/e/cache.I22A [15:17:34.727] package.json file content { "dependencies": { "tesseract.js": "*" } } > tesseract.js@2.1.4 postinstall C:\Users\Sergey\AppData\Roaming\BrowserAutomationStudio\apps\23.1.1\e\cache.I22A\distr\node_modules\tesseract.js > opencollective-postinstall || true npm http fetch GET 304 https://registry.npmjs.org/tesseract.js 273ms (from cache) npm http fetch GET 304 https://registry.npmjs.org/tesseract.js-core 262ms (from cache) npm info lifecycle tesseract.js-core@2.2.0~preinstall: tesseract.js-core@2.2.0 npm info lifecycle tesseract.js@2.1.4~preinstall: tesseract.js@2.1.4 npm info linkStuff tesseract.js-core@2.2.0 npm info linkStuff tesseract.js@2.1.4 npm info lifecycle tesseract.js-core@2.2.0~install: tesseract.js-core@2.2.0 npm info lifecycle tesseract.js@2.1.4~install: tesseract.js@2.1.4 npm info lifecycle tesseract.js-core@2.2.0~postinstall: tesseract.js-core@2.2.0 npm info lifecycle tesseract.js@2.1.4~postinstall: tesseract.js@2.1.4 npm verb lifecycle tesseract.js@2.1.4~postinstall: unsafe-perm in lifecycle true npm verb lifecycle tesseract.js@2.1.4~postinstall: PATH: C:\Users\Sergey\AppData\Roaming\BrowserAutomationStudio\apps\23.1.1\e\cache.I22A\distr\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Sergey\AppData\Roaming\BrowserAutomationStudio\apps\23.1.1\e\cache.I22A\distr\node_modules\tesseract.js\node_modules\.bin;C:\Users\Sergey\AppData\Roaming\BrowserAutomationStudio\apps\23.1.1\e\cache.I22A\distr\node_modules\.bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\ProgramData\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 (x86)\Brackets\command;C:\Program Files\nodejs\;C:\Users\Sergey\AppData\Local\Microsoft\WindowsApps;C:\Users\Sergey\AppData\Roaming\npm;C:\Users\Sergey\AppData\Local\Programs\Microsoft VS Code\bin; npm verb lifecycle tesseract.js@2.1.4~postinstall: CWD: C:\Users\Sergey\AppData\Roaming\BrowserAutomationStudio\apps\23.1.1\e\cache.I22A\distr\node_modules\tesseract.js npm info lifecycle tesseract.js@2.1.4~postinstall: Failed to exec postinstall script npm verb stack Error: tesseract.js@2.1.4 postinstall: `opencollective-postinstall || true` npm verb pkgid tesseract.js@2.1.4 npm ERR! tesseract.js@2.1.4 postinstall: `opencollective-postinstall || true` npm ERR! Failed at the tesseract.js@2.1.4 postinstall script. npm verb pkgid tesseract.js@2.1.4 npm ERR! tesseract.js@2.1.4 postinstall: `opencollective-postinstall || true` npm ERR! Failed at the tesseract.js@2.1.4 postinstall script.
Решил попробовать установить в отдельные проект через терминал Visual Studio Code:
npm install tesseract.js > tesseract.js@2.1.4 postinstall C:\xampp\htdocs\multiclick\node_modules\tesseract.js > opencollective-postinstall || true Thank you for using tesseract.js! If you rely on this package, please consider supporting our open collective: > https://opencollective.com/tesseractjs/donate npm WARN multiclick@1.0.0 No description npm WARN multiclick@1.0.0 No repository field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) + tesseract.js@2.1.4 added 18 packages from 19 contributors and audited 783 packages in 30.478s found 592 vulnerabilities (446 low, 146 high) run `npm audit fix` to fix them, or `npm audit` for details
И все установилось без ошибок, значит файлы не битые
Подскажите, как можно в обход автоматической установки установить нужный модуль, заранее огромное спасибо
-
@Sergey_yu
Присоединяюсь к вопросу, или может уже решил автор?
-
@www300 said in Как установить npm модуль вручную:
@Sergey_yu
Присоединяюсь к вопросу, или может уже решил автор?А просто указать путь до скаченного модуля в require не вариант?
-
@Fox said in Как установить npm модуль вручную:
А просто указать путь до скаченного модуля в require не вариант?
т.е. установить его через node и при подключении использовать полный путь из nodejs?
-
@www300 поставьте tesseract отдельно и будет вам счастье, в БАС не устанавливаются пакеты, которые требуют сборки из исходников