Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node-sass error and missing docker deployment #16

Open
vemonet opened this issue Apr 19, 2022 · 0 comments
Open

Node-sass error and missing docker deployment #16

vemonet opened this issue Apr 19, 2022 · 0 comments

Comments

@vemonet
Copy link

vemonet commented Apr 19, 2022

I tried to install and deploy the LDShapes locally, the backend seems to work, but the frontend does not manage to install due to version issue related to node-sass

I am using Fedora Linux 35, and the following version for npm and node:

npm -v
8.5.5
node -v
v17.9.0

Here is the full error log:

npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: 3.x is no longer supported
npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/address'
npm WARN deprecated [email protected]: 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 [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: Switch to 'npm install joi'
npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm ERR! code 1
npm ERR! path /home/vemonet/develop/sandbox/ldshapes/frontend/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /opt/conda/bin/node /home/vemonet/develop/sandbox/ldshapes/frontend/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! make: Entering directory '/home/vemonet/develop/sandbox/ldshapes/frontend/node_modules/node-sass/build'
npm ERR!   g++ -o Release/obj.target/libsass/src/libsass/src/ast.o ../src/libsass/src/ast.cpp '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DLIBSASS_VERSION="3.5.5"' -I/home/vemonet/.cache/node-gyp/17.9.0/include/node -I/home/vemonet/.cache/node-gyp/17.9.0/src -I/home/vemonet/.cache/node-gyp/17.9.0/deps/openssl/config -I/home/vemonet/.cache/node-gyp/17.9.0/deps/openssl/openssl/include -I/home/vemonet/.cache/node-gyp/17.9.0/deps/uv/include -I/home/vemonet/.cache/node-gyp/17.9.0/deps/zlib -I/home/vemonet/.cache/node-gyp/17.9.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fPIC -O3 -fno-omit-frame-pointer -std=gnu++17 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast.o.d.raw   -c
npm ERR! make: Leaving directory '/home/vemonet/develop/sandbox/ldshapes/frontend/node_modules/node-sass/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   '/opt/conda/bin/node',
npm ERR! gyp verb cli   '/home/vemonet/develop/sandbox/ldshapes/frontend/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 [email protected]
npm ERR! gyp info using [email protected] | linux | 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 find Python Python is not set from command line or npm configuration
npm ERR! gyp verb find Python Python is not set from environment variable PYTHON
npm ERR! gyp verb find Python checking if "python3" can be used
npm ERR! gyp verb find Python - executing "python3" to get executable path
npm ERR! gyp verb find Python - executable path is "/opt/conda/bin/python3"
npm ERR! gyp verb find Python - executing "/opt/conda/bin/python3" to get version
npm ERR! gyp verb find Python - version is "3.9.12"
npm ERR! gyp info find Python using Python version 3.9.12 found at "/opt/conda/bin/python3"
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 17.9.0
npm ERR! gyp verb command install [ '17.9.0' ]
npm ERR! gyp verb install input version string "17.9.0"
npm ERR! gyp verb install installing version: 17.9.0
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 9
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 17.9.0
npm ERR! gyp verb build dir attempting to create "build" dir: /home/vemonet/develop/sandbox/ldshapes/frontend/node_modules/node-sass/build
npm ERR! gyp verb build dir "build" dir needed to be created? /home/vemonet/develop/sandbox/ldshapes/frontend/node_modules/node-sass/build
npm ERR! gyp verb build/config.gypi creating config file
npm ERR! gyp verb build/config.gypi writing out config file: /home/vemonet/develop/sandbox/ldshapes/frontend/node_modules/node-sass/build/config.gypi
npm ERR! (node:55006) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp verb config.gypi checking for gypi file: /home/vemonet/develop/sandbox/ldshapes/frontend/node_modules/node-sass/config.gypi
npm ERR! gyp verb common.gypi checking for gypi file: /home/vemonet/develop/sandbox/ldshapes/frontend/node_modules/node-sass/common.gypi
npm ERR! gyp verb gyp gyp format was not specified; forcing "make"
npm ERR! gyp info spawn /opt/conda/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/vemonet/develop/sandbox/ldshapes/frontend/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/vemonet/develop/sandbox/ldshapes/frontend/node_modules/node-sass/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/vemonet/develop/sandbox/ldshapes/frontend/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/vemonet/.cache/node-gyp/17.9.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/vemonet/.cache/node-gyp/17.9.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/vemonet/develop/sandbox/ldshapes/frontend/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/vemonet/.cache/node-gyp/17.9.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/vemonet/develop/sandbox/ldshapes/frontend/node_modules/node-sass',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp verb command build []
npm ERR! gyp verb build type Release
npm ERR! gyp verb architecture x64
npm ERR! gyp verb node dev dir /home/vemonet/.cache/node-gyp/17.9.0
npm ERR! gyp verb `which` succeeded for `make` /usr/bin/make
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! make: g++: No such file or directory
npm ERR! make: *** [src/libsass.target.mk:160: Release/obj.target/libsass/src/libsass/src/ast.o] Error 127
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/home/vemonet/develop/sandbox/ldshapes/frontend/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 5.16.20-200.fc35.x86_64
npm ERR! gyp ERR! command "/opt/conda/bin/node" "/home/vemonet/develop/sandbox/ldshapes/frontend/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /home/vemonet/develop/sandbox/ldshapes/frontend/node_modules/node-sass
npm ERR! gyp ERR! node -v v17.9.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
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!     /home/vemonet/.npm/_logs/2022-04-19T11_33_35_839Z-debug-0.log

According to this article sass is not really stable and you need to be really strict with which NodeJS version you use: https://stackoverflow.com/questions/60394291/error-node-modules-node-sass-command-failed (so much for something that is just replacing some variables in CSS!)

A quick solution would be to upgrade node-sass to a newer version, but that might break it for people using older version of NodeJS (they can upgrade anyway, newer is better)

Ideally there should be a Dockerfile for backend and frontend, and the stack should be deployed using docker-compose. So that everyone get the exact environment, everything can be started in 1 reliable command, and the docker-compose file can be read by developers to understand every aspect of the deployment (which port is used? which volume?)

@vemonet vemonet changed the title Node-sass error Node-sass error and missing docker deployment Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant