shape shape shape shape shape shape
SupportCategory: Questionsnpm-gyp , gulp style does not work Trizen – Travel Hotel Booking HTML5 template with Dashboard
Escanor asked 7 months ago

Screenshot : Gulp node gyp, does not work

Very Weird , I can’t post an image here but anyway,

So I was following the documentation for installation of trizen 

Follow the steps below:

  1. Download the latest template source from ThemeForest.
  2. Extract Trizen downloaded zip file. Extracted zip file will have 2 folders.
  3. Trizen => main source files
  4. Documentation => guide lines
  5. We’ll start of the process by installing Gulp onto your computer. Gulp requires you to have Node.js and Node Package Manager (NPM) installed on your system, so if you haven’t gotten them yet,
    then go to Node.js’s website and download the installer.
  6. Once you’re done installing Node.js and NPM, you can install Gulp by typing the following command in the command line:
  7. Start with command prompt if you use windows or start with terminal if you use mac:
  1. sudo npm install gulp-cli -g

  2. # Note: Windows users do not require the `sudo` keyword

  3. cd / your joby folder directory

  4. npm install gulp –save-dev

  5. # Note: don’t use sudo keyword mac users and windows users now

  6. Now your gulp will be installed after run this command [npm install gulp –save-dev]

  7. Now go to your main file joby file. and You will also see a new folder > node_modulesthat was created when you ran the npm install gulp –save-dev command.

 

  1. Firstly , I cannot find the joby file?
  2. Secondly ,
    gulp style

    doesnt work , I even installed gulp globally 

  3. Node-gyp uses python 2 instead of python 3 , ( as print requires parenthesis in python 3 , it tries to execute print %s module._version %s which would not work ) 

I cannot compile sass and use gulp however as html is just plug and every other stuff would work.

Now my question is how would I resolve this , I mean a simple npm install should work  , but it think its not been updated to 2023 versions , even bootstrap is v4 ( i dont complain but atleast npm install should work ) 

Escanor replied 7 months ago

Environment :

Node: v19.4.0
npm : 9.2.0
OS: Windows 11
Python : 3.11 but also installed python2

# What I tried
Env variables : changed system path to have python2 to no effect
npm install –python=my/python2/path
deleted node_modules and reinstalled with npm install
installed gulp gloablly

# Error log

trizen-main\trizen>
npm install
npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
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 C:\Users\Rijul\Downloads\trizen-airfaremoss-theme\trizen-main\trizen\node_modules\gulp-sass\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 C:\Users\Rijul\Downloads\trizen-airfaremoss-theme\trizen-main\trizen\node_modules\gulp-sass\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 ‘C:\\Users\\Rijul\\Downloads\\trizen-airfaremoss-theme\\trizen-main\\trizen\\node_modules\\gulp-sass\\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@19.4.0 | 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 (C:\Users\Rijul\Downloads\trizen-airfaremoss-theme\trizen-main\trizen\node_modules\gulp-sass\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (C:\Users\Rijul\Downloads\trizen-airfaremoss-theme\trizen-main\trizen\node_modules\gulp-sass\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (C:\Users\Rijul\Downloads\trizen-airfaremoss-theme\trizen-main\trizen\node_modules\gulp-sass\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at C:\Users\Rijul\Downloads\trizen-airfaremoss-theme\trizen-main\trizen\node_modules\gulp-sass\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at C:\Users\Rijul\Downloads\trizen-airfaremoss-theme\trizen-main\trizen\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at C:\Users\Rijul\Downloads\trizen-airfaremoss-theme\trizen-main\trizen\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:190:21)
npm ERR! gyp verb `which` failed python2 Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (C:\Users\Rijul\Downloads\trizen-airfaremoss-theme\trizen-main\trizen\node_modules\gulp-sass\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (C:\Users\Rijul\Downloads\trizen-airfaremoss-theme\trizen-main\trizen\node_modules\gulp-sass\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (C:\Users\Rijul\Downloads\trizen-airfaremoss-theme\trizen-main\trizen\node_modules\gulp-sass\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at C:\Users\Rijul\Downloads\trizen-airfaremoss-theme\trizen-main\trizen\node_modules\gulp-sass\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at C:\Users\Rijul\Downloads\trizen-airfaremoss-theme\trizen-main\trizen\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at C:\Users\Rijul\Downloads\trizen-airfaremoss-theme\trizen-main\trizen\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:190: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:\Python310\python.EXE
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: C:\Python310\python.EXE -c import sys; print “%s.%s.%s” % sys.version_info[:3];
npm ERR! gyp ERR! stack File “”, 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:419:12)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1098:16)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:304:5)
npm ERR! gyp ERR! System Windows_NT 10.0.22621
npm ERR! gyp ERR! command “C:\\Program Files\\nodejs\\node.exe” “C:\\Users\\Rijul\\Downloads\\trizen-airfaremoss-theme\\trizen-main\\trizen\\node_modules\\gulp-sass\\node_modules\\node-gyp\\bin\\node-gyp.js” “rebuild” “–verbose” “–libsass_ext=” “–libsass_cflags=” “–libsass_ldflags=” “–libsass_library=”
npm ERR! gyp ERR! cwd C:\Users\Rijul\Downloads\trizen-airfaremoss-theme\trizen-main\trizen\node_modules\gulp-sass\node_modules\node-sass
npm ERR! gyp ERR! node -v v19.4.0
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\Rijul\AppData\Local\npm-cache\_logs\2023-07-24T07_48_10_530Z-debug-0.log

C:\Users\Rijul\Downloads\trizen-airfaremoss-theme\trizen-main\trizen>npm install gulp -g
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated

Escanor replied 7 months ago

# Steps to replicate

Download the latest template source from ThemeForest.
Extract Trizen downloaded zip file. Extracted zip file will have 2 folders.
Trizen => main source files
Documentation => guide lines
We’ll start of the process by installing Gulp onto your computer. Gulp requires you to have Node.js and Node Package Manager (NPM) installed on your system, so if you haven’t gotten them yet,
then go to Node.js’s website and download the installer.
Once you’re done installing Node.js and NPM, you can install Gulp by typing the following command in the command line:
Start with command prompt if you use windows or start with terminal if you use mac:
sudo npm install gulp-cli -g
# Note: Windows users do not require the `sudo` keyword
cd / your joby folder directory
npm install gulp –save-dev
# Note: don’t use sudo keyword mac users and windows users now
Now your gulp will be installed after run this command [npm install gulp –save-dev]
Now go to your main file joby file. and You will also see a new folder > node_modules
that was created when you ran the npm install gulp –save-dev command.
Sass Install
sudo npm install -g sass
# Note: Windows users do not require the `sudo` keyword
// go to the project root in the terminal using the CD command.
// in the root of your project directory run the following commands.
A. To compile sass use the following command [gulp style]
B. To watch for changes in SASS file and to compile automatically use the following
command > [gulp watch], and to stop watching files,
use CTRL + C on Windows or Command + C on Mac OS

Gulp style shows

gulp style
Error: Cannot find module ‘gulp-sass’
Require stack:
– C:\Users\Rijul\Downloads\trizen-airfaremoss-theme\trizen-main\trizen\gulpfile.js
– C:\Users\Rijul\AppData\Roaming\nvm\v19.4.0\node_modules\gulp\node_modules\gulp-cli\lib\shared\require-or-import.js
– C:\Users\Rijul\AppData\Roaming\nvm\v19.4.0\node_modules\gulp\node_modules\gulp-cli\lib\versioned\^4.0.0\index.js
– C:\Users\Rijul\AppData\Roaming\nvm\v19.4.0\node_modules\gulp\node_modules\gulp-cli\index.js
– C:\Users\Rijul\AppData\Roaming\nvm\v19.4.0\node_modules\gulp\bin\gulp.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1053:15)
at Module._load (node:internal/modules/cjs/loader:898:27)
at Module.require (node:internal/modules/cjs/loader:1120:19)
at require (node:internal/modules/helpers:112:18)
at Object. (C:\Users\Rijul\Downloads\trizen-airfaremoss-theme\trizen-main\trizen\gulpfile.js:2:14)
at Module._compile (node:internal/modules/cjs/loader:1239:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1293:10)
at Module.load (node:internal/modules/cjs/loader:1096:32)
at Module._load (node:internal/modules/cjs/loader:935:12)
at Module.require (node:internal/modules/cjs/loader:1120:19) {
code: ‘MODULE_NOT_FOUND’,
requireStack: [
‘C:\\Users\\Rijul\\Downloads\\trizen-airfaremoss-theme\\trizen-main\\trizen\\gulpfile.js’,
‘C:\\Users\\Rijul\\AppData\\Roaming\\nvm\\v19.4.0\\node_modules\\gulp\\node_modules\\gulp-cli\\lib\\shared\\require-or-import.js’,
‘C:\\Users\\Rijul\\AppData\\Roaming\\nvm\\v19.4.0\\node_modules\\gulp\\node_modules\\gulp-cli\\lib\\versioned\\^4.0.0\\index.js’,
‘C:\\Users\\Rijul\\AppData\\Roaming\\nvm\\v19.4.0\\node_modules\\gulp\\node_modules\\gulp-cli\\index.js’,
‘C:\\Users\\Rijul\\AppData\\Roaming\\nvm\\v19.4.0\\node_modules\\gulp\\bin\\gulp.js’
]
}

1 Answers
Escanor answered 7 months ago

So I’m answering my own question now as I have found the answer and would to help out any others having the same issue  , I tried editing the question so that its more searchable but its not so anyway 

Solution
Basically, the reason this happens is because of newer node versions. Check this stackoverflow answer which explains what version of node works with what version of gulp and node-gyp
To fix the issue you just need to

  1. change the package.json to this version for node v19.14.0 and npm 9.2:
    {
      "name": "trizen",
      "version": "1.0.0",
      "description": "Travel booking website",
      "main": "index.js",
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
      },
      "repository": {
        "type": "git",
        "url": "git+https://github.com/kamran-hussen/trizen.git"
      },
      "author": "Kamran Ahmed",
      "license": "ISC",
      "bugs": {
        "url": "https://github.com/kamran-hussen/trizen/issues"
      },
      "homepage": "https://github.com/kamran-hussen/trizen#readme",
      "devDependencies": {
        "browser-sync": "^2.29.3",
        "gulp": "^4.0.2",
        "gulp-sass": "^5.1.0"
      },
      "dependencies": {
        "node-sass": "^9.0.0",
        "sass": "^1.64.1",
        "sweetalert2": "^11.7.20"
      }
    }
  2. run npm install sass
  3. Inside the gulpfile.js, add the following line const sass = require('gulp-sass')(require('sass'));  
  4.  then run
    gulp style 

    and it would work as intended.

Remarks
Hope it works , if you have any questions or any improvements to be made, please do reply to this question and I request the admin @Kamal to add the new fix to the documentations so that it helps new people who get this template

thanks!</p