I face some Error during bench creation

[5/5] Building fresh packages…
[1/5] ⡀ node-sass
[-/5] ⡀ waiting…
[3/5] ⡀ esbuild
[-/5] ⢀ waiting…
error /home/godabaouser/Projects/Freshers/Training7/apps/frappe/node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: /home/godabaouser/Projects/Freshers/Training7/apps/frappe/node_modules/node-sass
Output:
Building: /usr/local/bin/node /home/godabaouser/Projects/Freshers/Training7/apps/frappe/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli ‘/usr/local/bin/node’,
gyp verb cli ‘/home/godabaouser/Projects/Freshers/Training7/apps/frappe/node_modules/node-gyp/bin/node-gyp.js’,
gyp verb cli ‘rebuild’,
gyp verb cli ‘–verbose’,
gyp verb cli ‘–libsass_ext=’,
gyp verb cli ‘–libsass_cflags=’,
gyp verb cli ‘–libsass_ldflags=’,
gyp verb cli ‘–libsass_library=’
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@16.5.0 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing “build” directory
gyp verb command configure []
gyp verb check python checking for Python executable “python2” in the PATH
gyp verb which succeeded python2 /usr/bin/python2
gyp verb check python version /usr/bin/python2 -c "import sys; print "2.7.12 gyp verb check python version .%s.%s" % sys.version_info[:3];" returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 16.5.0
gyp verb command install [ ‘16.5.0’ ]
gyp verb install input version string “16.5.0”
gyp verb install installing version: 16.5.0
gyp verb install --ensure was passed, so won’t reinstall if already installed
gyp verb install version is already installed, need to check “installVersion”
gyp verb got “installVersion” 9
gyp verb needs “installVersion” 9
gyp verb install version is good
gyp verb get node dir target node version installed: 16.5.0
gyp verb build dir attempting to create “build” dir: /home/godabaouser/Projects/Freshers/Training7/apps/frappe/node_modules/node-sass/build
gyp verb build dir “build” dir needed to be created? /home/godabaouser/Projects/Freshers/Training7/apps/frappe/node_modules/node-sass/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /home/godabaouser/Projects/Freshers/Training7/apps/frappe/node_modules/node-sass/build/config.gypi
(node:22942) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use node --trace-deprecation ... to show where the warning was created)
gyp verb config.gypi checking for gypi file: /home/godabaouser/Projects/Freshers/Training7/apps/frappe/node_modules/node-sass/config.gypi
gyp verb common.gypi checking for gypi file: /home/godabaouser/Projects/Freshers/Training7/apps/frappe/node_modules/node-sass/common.gypi
gyp verb gyp gyp format was not specified; forcing “make”
gyp info spawn /usr/bin/python2
gyp info spawn args [
gyp info spawn args ‘/home/godabaouser/Projects/Freshers/Training7/apps/frappe/node_modules/node-gyp/gyp/gyp_main.py’,
gyp info spawn args ‘binding.gyp’,
gyp info spawn args ‘-f’,
gyp info spawn args ‘make’,
gyp info spawn args ‘-I’,
gyp info spawn args ‘/home/godabaouser/Projects/Freshers/Training7/apps/frappe/node_modules/node-sass/build/config.gypi’,
gyp info spawn args ‘-I’,
gyp info spawn args ‘/home/godabaouser/Projects/Freshers/Training7/apps/frappe/node_modules/node-gyp/addon.gypi’,
gyp info spawn args ‘-I’,
gyp info spawn args ‘/home/godabaouser/.node-gyp/16.5.0/include/node/common.gypi’,
gyp info spawn args ‘-Dlibrary=shared_library’,
gyp info spawn args ‘-Dvisibility=default’,
gyp info spawn args ‘-Dnode_root_dir=/home/godabaouser/.node-gyp/16.5.0’,
gyp info spawn args ‘-Dnode_gyp_dir=/home/godabaouser/Projects/Freshers/Training7/apps/frappe/node_modules/node-gyp’,
gyp info spawn args ‘-Dnode_lib_file=/home/godabaouser/.node-gyp/16.5.0/<(target_arch)/node.lib’,
gyp info spawn args ‘-Dmodule_root_dir=/home/godabaouser/Projects/Freshers/Training7/apps/frappe/node_modules/node-sass’,
gyp info spawn args ‘-Dnode_engine=v8’,
gyp info spawn args ‘–depth=.’,
gyp info spawn args ‘–no-parallel’,
gyp info spawn args ‘–generator-output’,
gyp info spawn args ‘build’,
gyp info spawn args ‘-Goutput_dir=.’
gyp info spawn args ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir /home/godabaouser/.node-gyp/16.5.0
gyp verb which succeeded for make /usr/bin/make
gyp info spawn make
gyp info spawn args [ ‘V=1’, ‘BUILDTYPE=Release’, ‘-C’, ‘build’ ]
make: Entering directory
gyp ERR! node -v v16.5.0
gyp ERR! node-gyp -v v3.8.0

Normally when I see node gyp errors, the root cause is incompatible versions of:

  • Python (yes, Node actually depends on Python. This was surprising at first)
  • Node
  • Node Sass.

To find out if that’s the problem, try this:

  1. Find out what version of Node you have:
node -v
  1. Find out what version of Node SASS you have.
# This shows what -should- have installed:
cd [path_to_your_bench_directory]
cat apps/frappe/package.json | grep node-sass

OR alternately

# This shows what is -actually- installed:
cd [path_to_your_bench_directory]
cd apps/frappe
yarn list --depth 0 | grep sass
  1. The link and screenshot below shows the compatibility (only first 2 columns important):

https://www.npmjs.com/package/node-sass

image

If your versions are not compatible, it’s a bit easier (imo) to change your Node version to match.

Changing your Node SASS version is more-difficult, because 'package.json' and 'yarn.lock' are part of the Frappe git repository. So modifying them technically means you’re forking it. Which is fine. But adds some extra maintenance for you.

2 Likes

thank you sir i’ll check