mirror of
https://github.com/jehna/humanify.git
synced 2026-04-27 17:45:58 +03:00
[GH-ISSUE #135] install problem #47
Labels
No labels
bug
enhancement
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/humanify#47
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Yusufkulcu on GitHub (Sep 29, 2024).
Original GitHub issue: https://github.com/jehna/humanify/issues/135
I bought a new virtual server and I'm trying to install it. but I get the errors in the images. what could be the problem?
I added the error log below
command used: "npm install -g humanifyjs"
log.txt
@jehna commented on GitHub (Sep 29, 2024):
What's your
node --version@Yusufkulcu commented on GitHub (Sep 29, 2024):
@Yusufkulcu commented on GitHub (Sep 29, 2024):
I have v20.10.0 installed on my computer. I installed the same on the virtual server and tried again. First, it gave the error "Python is not installed" and then it gave the errors I added below.
operating system: server 2019
node version : v20.10.0
python version : Python 3.12.6
@Yusufkulcu commented on GitHub (Sep 29, 2024):
Do you have any solution suggestions?
@0xdevalias commented on GitHub (Sep 30, 2024):
Potentially duplicate of/similar root cause as the following issues:
With some notes from there:
Skimming through the initial attached log, there seem to be a number of errors/warnings.
This part might not matter (not 100%, just guessing):
This is probably a breaking error:
This is probably only needed because no prebuilt binary was found:
Failing to load a prebuilt binary is probably based on a combination of node version and system architecture. Then the 'build from source' might be failing because you're running it in
cmd.exerather than a shell like bash/similar (assuming it's written to be built on a *nix type system), or because you don't have appropriate dev tools installed/similar:We can see the prebuilt dependencies in the
node-llama-cpppackage.jsonhere:github.com/withcatai/node-llama-cpp@4ee10a90e9/package.json (L212-L224)The source for these are here:
Since there is a
@node-llama-cpp/win-x64, theFailed to load a prebuilt binary for platform "win" "x64"part of the error is definitely.. interesting.@Yusufkulcu Does the machine you're installing this on have access to the internet? I'm guessing it tries to dynamically decide which optional binary package it will need based on the system and install that.
We can see that when building the package, it runs
npm run addPostinstallScript:github.com/withcatai/node-llama-cpp@4ee10a90e9/.github/workflows/build.yml (L465-L493)Which we can see is defined in
package.json, and basically tells the built package to triggernode ./dist/cli/cli.js postinstall:github.com/withcatai/node-llama-cpp@4ee10a90e9/package.json (L51)In
cli/cli.jswe can see that it registers theOnPostInstallCommand:github.com/withcatai/node-llama-cpp@4ee10a90e9/src/cli/cli.ts (L39)Which is defined here, and calls
getLlamaForOptions:github.com/withcatai/node-llama-cpp@4ee10a90e9/src/cli/commands/OnPostInstallCommand.ts (L8-L30)Which is defined here, and seems to be the part of the package that gets the systems platform/architecture, and tries to determine if it can use prebuilt binaries or not/etc:
github.com/withcatai/node-llama-cpp@4ee10a90e9/src/bindings/getLlama.ts (L291-L462)Within that, we can see there is a call to
loadExistingLlamaBinary:github.com/withcatai/node-llama-cpp@4ee10a90e9/src/bindings/getLlama.ts (L367-L387)github.com/withcatai/node-llama-cpp@4ee10a90e9/src/bindings/getLlama.ts (L464-L623)That calls
getPrebuiltBinaryPath, which then callsgetPrebuiltBinariesPackageDirectoryForBuildOptions, which is what handles attempting to import the various prebuilt binary packages:github.com/withcatai/node-llama-cpp@4ee10a90e9/src/bindings/getLlama.ts (L547-L553)getPrebuiltBinaryPath:github.com/withcatai/node-llama-cpp@4ee10a90e9/src/bindings/utils/compileLLamaCpp.ts (L286-L313)getPrebuiltBinariesPackageDirectoryForBuildOptions:github.com/withcatai/node-llama-cpp@4ee10a90e9/src/bindings/utils/compileLLamaCpp.ts (L364-L426)This then calls
getBinariesPathFromModuleswhich seems to do some stuff to find the bins dir:github.com/withcatai/node-llama-cpp@4ee10a90e9/src/bindings/utils/compileLLamaCpp.ts (L365-L383)Jumping back out to
loadExistingLlamaBinary, we can see the 'failed to load a prebuilt binary' message here within acatchblock:github.com/withcatai/node-llama-cpp@4ee10a90e9/src/bindings/getLlama.ts (L598-L611)The actual triggering error is appended to the end of that message, so the root issue appears to be this part:
@Yusufkulcu So I guess the first thing I would be doing is checking whether that file actually exists, and if there is anything that might be blocking it from being able to be loaded (permissions, antivirus, etc):
C:\Users\Administrator\AppData\Roaming\npm\node_modules\humanifyjs\node_modules\@node-llama-cpp\win-x64\bins\win-x64\llama-addon.nodeIf that doesn't help, you may be able to get some more specific ideas/support on the GitHub Discussions page for
node-llama-cpp:I took the liberty to open a discussion there based on this issue to potentially expediate getting an official answer:
@Yusufkulcu @jehna It seems that
humanifyis currently usingnode-llama-cpp3.0.0-beta.40:github.com/jehna/humanify@64a1b9511d/package.json (L57)Whereas it seems to now be up to
3.0.3, so it's possible there have been some relevant bug fixes/improvements released since then:@Yusufkulcu The error in your screenshot here is a different error to the one in your initial post. The error you're getting on the virtual server here is related to there not being a prebuilt binary for
isolated-vmfor that server; which is basically the root cause of this issue:But solving that won't solve the issues you're having on your main system install.
@0xdevalias commented on GitHub (Sep 30, 2024):
@Yusufkulcu Some further ideas/google results based on
Error: EPERM: operation not permitted, rmdir 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\humanifyjs\node_modules\node-llama-cpp\llama\llama.cpp'npm cache clean --forcenpminstall location prefixhumanifyjsspecific.npm cache clean@0xdevalias commented on GitHub (Oct 15, 2024):
Some notes from upstream:
Full comment: