0

Here is the code

E:\Programming\Android app development>ionic start Demo blank --type ionic1
√ Preparing directory .\Demo in 2.92ms
√ Downloading and extracting blank starter in 1.80s
? Integrate your new app with Capacitor to target native iOS and Android? Yes
> ionic integrations enable capacitor --quiet -- Demo io.ionic.starter
> npm.cmd i --save -E @capacitor/core@latest
npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code 1
npm ERR! path E:\Programming\Android app development\Demo\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe E:\Programming\Android app development\Demo\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli   'E:\\Programming\\Android app development\\Demo\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.13.1 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (E:\Programming\Android app development\Demo\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (E:\Programming\Android app development\Demo\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (E:\Programming\Android app development\Demo\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at E:\Programming\Android app development\Demo\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` f`enter code here`ailed     at E:\Programming\Android app development\Demo\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at E:\Programming\Android app development\Demo\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed  python2 Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (E:\Programming\Android app development\Demo\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (E:\Programming\Android app development\Demo\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (E:\Programming\Android app development\Demo\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at E:\Programming\Android app development\Demo\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at E:\Programming\Android app development\Demo\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at E:\Programming\Android app development\Demo\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb check python checking for Python executable "python" in the PATH
npm ERR! gyp verb `which` succeeded python C:\Users\samprithazra\AppData\Local\Programs\Python\Python310\python.EXE
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: C:\Users\samprithazra\AppData\Local\Programs\Python\Python310\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack   File "<string>", line 1
npm ERR! gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm ERR! gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:397:12)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\Programming\\Android app development\\Demo\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd E:\Programming\Android app development\Demo\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\samprithazra\AppData\Local\npm-cache\_logs\2021-12-10T07_18_12_049Z-debug-0.log
[ERROR] An error occurred while running subprocess npm.

        npm.cmd i --save -E @capacitor/core@latest exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

Installing dependencies may take several minutes.

  ──────────────────────────────────────────────────────────────────────

      Ionic Enterprise, platform and solutions for teams by Ionic

                  Powerful library of native APIs
                 A supercharged platform for teams

         Learn more: https://ion.link/enterprise

  ──────────────────────────────────────────────────────────────────────


> npm.cmd i
npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code 1
npm ERR! path E:\Programming\Android app development\Demo\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe E:\Programming\Android app development\Demo\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli   'E:\\Programming\\Android app development\\Demo\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.13.1 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (E:\Programming\Android app development\Demo\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (E:\Programming\Android app development\Demo\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (E:\Programming\Android app development\Demo\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at E:\Programming\Android app development\Demo\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at E:\Programming\Android app development\Demo\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at E:\Programming\Android app development\Demo\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed  python2 Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (E:\Programming\Android app development\Demo\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (E:\Programming\Android app development\Demo\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (E:\Programming\Android app development\Demo\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at E:\Programming\Android app development\Demo\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at E:\Programming\Android app development\Demo\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at E:\Programming\Android app development\Demo\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb check python checking for Python executable "python" in the PATH
npm ERR! gyp verb `which` succeeded python C:\Users\samprithazra\AppData\Local\Programs\Python\Python310\python.EXE
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: C:\Users\samprithazra\AppData\Local\Programs\Python\Python310\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack   File "<string>", line 1
npm ERR! gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm ERR! gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:397:12)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\Programming\\Android app development\\Demo\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd E:\Programming\Android app development\Demo\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\samprithazra\AppData\Local\npm-cache\_logs\2021-12-10T07_18_59_237Z-debug-0.log
[ERROR] An error occurred while running subprocess npm.

        npm.cmd i exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

E:\Programming\Android app development>

How to fix this? I am running Nodejs 16.13.1 in Windows 10 64bit. I think maybe it is the problem of Nodejs version. But from my side i haven't found anything wrong. I will glad to know if anything is wrong there.

James Z
  • 12,209
  • 10
  • 24
  • 44
Samprit
  • 41
  • 1
  • 4
  • make sure u have the recommended node js version – Mostafa Harb Dec 10 '21 at 09:34
  • How to check that recommended node js version – Samprit Dec 10 '21 at 09:57
  • `https://nodejs.org/en/` , downlaod the LTS which is the recommended version, and make sure u have capacitor compatibale with it, so best situation is to uninstall ionic then download it again with capacitor @latest since for sure it will be compatibale with the recomended nodejs – Mostafa Harb Dec 10 '21 at 12:07
  • you added the ionic1 flag. That would have to use very old packages and I am sure Node 16 is not support for AngularJS. You need to Dockerize this and use like Node 6 if you want to use Ionic v1. – eDriven_Levar Dec 10 '21 at 13:58
  • I have now fixed this issue I used node js 14.16.1.Then it solved the problem. – Samprit Dec 11 '21 at 13:14

1 Answers1

0

NodeJS relies on GYP which runs on Python. You need to make sure your python version installed in your system is compatible with your GYP version.

Your build fails due to the following Python error during GYP execution:

import sys; print "%s.%s.%s" % sys.version_info[:3];  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

This is a very classic issue which usually means you're trying to run a python2.x script with python3.x interpreter.

You need to ensure that node version, gyp version and python version are all compatible.

Currently you're trying to build with :

  • node v16.13.1
  • gyp v3.8.0
  • python v3.x?

GYP only supports Python 3.x starting in v5.0.5 I believe. You need to either update GYP & NPM or use python2.7.

zakinster
  • 10,508
  • 1
  • 41
  • 52