Despite clearing the cache and removing all references to node-sass in my projects i am STILL getting this stupid issue! I removed node-sass and replaced it with sass and despite my clearing of the cache it still tries to use node-sass.
#9
49.19 npm ERR! code 1
Feb 4 02:24:37 PM#9 49.19 npm ERR! path /app/node_modules/node-sass
Feb 4 02:24:37 PM#9 49.19 npm ERR! command failed
Feb 4 02:24:37 PM#9 49.19 npm ERR! command sh -c node scripts/build.js
Feb 4 02:24:37 PM#9 49.19 npm ERR! Building: /app/.heroku/node/bin/node /app/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp info it worked if it ends with ok
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb cli [
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb cli ‘/app/.heroku/node/bin/node’,
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb cli ‘/app/node_modules/node-gyp/bin/node-gyp.js’,
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb cli ‘rebuild’,
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb cli ‘–verbose’,
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb cli ‘–libsass_ext=’,
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb cli ‘–libsass_cflags=’,
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb cli ‘–libsass_ldflags=’,
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb cli ‘–libsass_library=’
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb cli ]
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp info using [email protected]
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp info using [email protected] | linux | x64
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb command rebuild
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb command clean
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb clean removing “build” directory
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb command configure
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb check python checking for Python executable “python2” in the PATH
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb
which
failed Error: not found: python2
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb
which
failed at getNotFoundError (/app/node_modules/which/which.js:13:12)
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb
which
failed at F (/app/node_modules/which/which.js:68:19)
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb
which
failed at E (/app/node_modules/which/which.js:80:29)
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb
which
failed at /app/node_modules/which/which.js:89:16
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb
which
failed at /app/node_modules/isexe/index.js:42:5
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb
which
failed at /app/node_modules/isexe/mode.js:8:5
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb
which
failed at FSReqCallback.oncomplete (node:fs:198:21)
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb
which
failed python2 Error: not found: python2
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb
which
failed at getNotFoundError (/app/node_modules/which/which.js:13:12)
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb
which
failed at F (/app/node_modules/which/which.js:68:19)
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb
which
failed at E (/app/node_modules/which/which.js:80:29)
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb
which
failed at /app/node_modules/which/which.js:89:16
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb
which
failed at /app/node_modules/isexe/index.js:42:5
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb
which
failed at /app/node_modules/isexe/mode.js:8:5
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb
which
failed at FSReqCallback.oncomplete (node:fs:198:21) {
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb
which
failed code: ‘ENOENT’
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb
which
failed }
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb check python checking for Python executable “python” in the PATH
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp verb
which
succeeded python /usr/bin/python
Feb 4 02:24:37 PM#9 49.19 npm ERR! gyp ERR! configure error
Feb 4 02:24:37 PM#9 49.24 npm ERR! gyp ERR! stack Error: Command failed: /usr/bin/python -c import sys; print “%s.%s.%s” % sys.version_info[:3];
Feb 4 02:24:37 PM#9 49.24 npm ERR! gyp ERR! stack File “”, line 1
Feb 4 02:24:37 PM#9 49.24 npm ERR! gyp ERR! stack import sys; print “%s.%s.%s” % sys.version_info[:3];
Feb 4 02:24:37 PM#9 49.24 npm ERR! gyp ERR! stack ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 4 02:24:37 PM#9 49.24 npm ERR! gyp ERR! stack SyntaxError: Missing parentheses in call to ‘print’. Did you mean print(…)?
Feb 4 02:24:37 PM#9 49.24 npm ERR! gyp ERR! stack
Feb 4 02:24:37 PM#9 49.24 npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:398:12)
Feb 4 02:24:37 PM#9 49.24 npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:527:28)
Feb 4 02:24:37 PM#9 49.24 npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1092:16)
Feb 4 02:24:37 PM#9 49.24 npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
Feb 4 02:24:37 PM#9 49.24 npm ERR! gyp ERR! System Linux 5.15.0-1052-aws
Feb 4 02:24:37 PM#9 49.24 npm ERR! gyp ERR! command “/app/.heroku/node/bin/node” “/app/node_modules/node-gyp/bin/node-gyp.js” “rebuild” “–verbose” “–libsass_ext=” “–libsass_cflags=” “–libsass_ldflags=” “–libsass_library=”
Feb 4 02:24:37 PM#9 49.24 npm ERR! gyp ERR! cwd /app/node_modules/node-sass
Feb 4 02:24:37 PM#9 49.24 npm ERR! gyp ERR! node -v v16.15.1
Feb 4 02:24:37 PM#9 49.24 npm ERR! gyp ERR! node-gyp -v v3.8.0
Feb 4 02:24:37 PM#9 49.24 npm ERR! gyp ERR! not ok
Feb 4 02:24:37 PM#9 49.24 npm ERR! Build failed with error code: 1
Feb 4 02:24:37 PM#9 49.24
Feb 4 02:24:37 PM#9 49.24 npm ERR! A complete log of this run can be found in:
Feb 4 02:24:37 PM#9 49.24 npm ERR! /tmp/npmcache.x779z/_logs/2024-02-04T22_24_00_002Z-debug-0.log
Feb 4 02:24:37 PM#9 49.29
Feb 4 02:24:37 PM#9 49.29 -----> Build failed
Hi there,
The issue here was that one of the listed node modules in the package.json was still pulling in
node-sass
. The error see happens because the image we use in our services migrated from Heroku using the Heroku CLI plugin contains Python3 and
import sys; print “%s.%s.%s” % sys.version_info[:3];
isn’t valid syntax for Python3.
Regards,
Keith
Render Support, UTC+10