Can't get this to build - Python 2 dep + issues upgrading package.json
Opened this issue · 0 comments
winny- commented
It seems node-gyp is pulled in via node-sass. This old version of node-gyp requires Python 2.x. weirdly enough its version checks are broken, so if you install the latest 2.x release it cause the build to fail:
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /nix/store/jjdg4qqg1744zw7fd0wa508k3pyp98r0-python-2.7.18.6/bin/python2
gyp verb check python version `/nix/store/jjdg4qqg1744zw7fd0wa508k3pyp98r0-python-2.7.18.6/bin/python2 -c "import platform; print(platform.python_version());"` returned: "2.7.18.6\n"
gyp ERR! configure error
gyp ERR! stack Error: Python executable "/nix/store/jjdg4qqg1744zw7fd0wa508k3pyp98r0-python-2.7.18.6/bin/python2" is v2.7.18.6, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
It also appears node-sass is deprecated and a new update of gulp-sass pulls in its replacement. I tried updating the package.json but ran into the following errors when I tried npm run start
:
winston@stargate ~/p/terminal.sexy $ npm run start
> terminal.sexy@0.4.0 start
> gulp
gulp[1239988]: ../src/node_contextify.cc:710:static void node::contextify::ContextifyScript::New(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `args[1]->IsString()' failed.
1: 0xa65478 node::Abort() [gulp]
2: 0xa65507 [gulp]
3: 0xa568c3 node::contextify::ContextifyScript::New(v8::FunctionCallbackInfo<v8::Value> const&) [gulp]
4: 0xcb145e v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [gulp]
5: 0xcb1adf [gulp]
6: 0xcb2263 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [gulp]
7: 0x1574279 [gulp]
Aborted (core dumped)
winston@stargate ~/p/terminal.sexy $ node --version
v16.19.1
winston@stargate ~/p/terminal.sexy $ npm --version
8.19.3
Here's the patch I tried:
diff --git a/package.json b/package.json
index a7daf28..8a50628 100644
--- a/package.json
+++ b/package.json
@@ -22,11 +22,11 @@
"brfs": "^1.4.0",
"browserify": "^9.0.3",
"chai": "^2.1.0",
- "gulp": "^3.8.11",
+ "gulp": "^3.9.1",
"gulp-autoprefixer": "^2.1.0",
"gulp-connect": "^2.2.0",
"gulp-replace": "^0.5.3",
- "gulp-sass": "^3.1.0",
+ "gulp-sass": "^5.1.0",
"gulp-uglify": "^1.1.0",
"mocha": "^2.1.0",
"reactify": "^1.0.0",
@@ -43,7 +43,7 @@
"husl": "^5.0.2",
"jquery": "^2.1.3",
"lodash": "^3.3.1",
- "node-sass": "^4.5.3",
+ "sass": "^1.63.2",
"react": "^0.12.2",
"react-colorpicker": "^0.3.9",
"react-ranger": "^0.5.5",