ghostcode-canary 0.2.1-canary.0 → 0.2.1-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/promt.md +24 -0
- package/setup.js +23 -7
package/package.json
CHANGED
package/promt.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
I am trying to install "ghostcode-ai" globally using npm inside a Termux/proot environment (Node v20.19.2). The installation fails with this error:
|
|
2
|
+
|
|
3
|
+
"Venv verification failed after install"
|
|
4
|
+
|
|
5
|
+
The setup script tries to create a Python virtual environment in:
|
|
6
|
+
/root/.npm-global/lib/node_modules/ghostcode-ai/.venv
|
|
7
|
+
|
|
8
|
+
But it fails even after installing python, pip, and binutils.
|
|
9
|
+
|
|
10
|
+
Environment details:
|
|
11
|
+
- Running on Termux (Android) with proot
|
|
12
|
+
- Node.js v20.19.2
|
|
13
|
+
- npm global install
|
|
14
|
+
- Python3 is installed
|
|
15
|
+
|
|
16
|
+
I need a solution that:
|
|
17
|
+
1. Fixes the Python venv creation issue in Termux/proot
|
|
18
|
+
2. Ensures pip works correctly inside the venv
|
|
19
|
+
3. Avoids permission/path issues common in Termux
|
|
20
|
+
4. Suggests any required environment variables or flags (like --unsafe-perm)
|
|
21
|
+
|
|
22
|
+
If ghostcode-ai is incompatible with Termux, suggest a workaround or alternative setup.
|
|
23
|
+
|
|
24
|
+
Explain the root cause and provide a working fix.
|
package/setup.js
CHANGED
|
@@ -38,12 +38,28 @@ if (fs.existsSync(venv)) {
|
|
|
38
38
|
console.log("Setting up GhostCode...");
|
|
39
39
|
|
|
40
40
|
try {
|
|
41
|
-
const pythonCmd = isWindows ? "python" : "python3";
|
|
42
|
-
execSync(pythonCmd + " -m venv
|
|
43
|
-
execSync(python + " -m pip install --upgrade pip setuptools wheel", { cwd: root, stdio: "pipe" });
|
|
41
|
+
const pythonCmd = isTermux || isWindows ? "python" : "python3";
|
|
42
|
+
execSync(pythonCmd + " -m venv .venv", { cwd: root, stdio: "pipe" });
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
if (isTermux) {
|
|
45
|
+
try {
|
|
46
|
+
execSync(python + " -m ensurepip --upgrade", { cwd: root, stdio: "pipe" });
|
|
47
|
+
} catch {
|
|
48
|
+
execSync(python + " -m pip install --upgrade pip setuptools wheel", { cwd: root, stdio: "pipe" });
|
|
49
|
+
}
|
|
50
|
+
} else {
|
|
51
|
+
execSync(python + " -m pip install --upgrade pip setuptools wheel", { cwd: root, stdio: "pipe" });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (isTermux) {
|
|
55
|
+
try {
|
|
56
|
+
execSync(pip + " install --no-build-isolation " + pkg, { cwd: root, stdio: "pipe" });
|
|
57
|
+
} catch {
|
|
58
|
+
execSync(pip + " install " + pkg, { cwd: root, stdio: "pipe" });
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
execSync(pip + " install -e " + pkg, { cwd: root, stdio: "pipe" });
|
|
62
|
+
}
|
|
47
63
|
|
|
48
64
|
if (!verifyVenv()) {
|
|
49
65
|
throw new Error("Venv verification failed after install");
|
|
@@ -54,10 +70,10 @@ try {
|
|
|
54
70
|
console.error("Setup failed:", e.message);
|
|
55
71
|
if (isTermux) {
|
|
56
72
|
console.error("");
|
|
57
|
-
console.error(" Termux manual:");
|
|
73
|
+
console.error(" Termux manual setup:");
|
|
58
74
|
console.error(" pkg install python python-pip binutils");
|
|
59
75
|
console.error(" rm -rf " + venv);
|
|
60
|
-
console.error("
|
|
76
|
+
console.error(" python -m venv " + venv);
|
|
61
77
|
console.error(" " + pip + " install --upgrade pip setuptools wheel");
|
|
62
78
|
console.error(" " + pip + " install " + pkg);
|
|
63
79
|
console.error(" " + python + " -m ghostcode");
|