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

Can't pass over the yarn build (even with some modifications) #37

Open
kCyborg opened this issue Sep 20, 2024 · 0 comments
Open

Can't pass over the yarn build (even with some modifications) #37

kCyborg opened this issue Sep 20, 2024 · 0 comments

Comments

@kCyborg
Copy link

kCyborg commented Sep 20, 2024

Hi there:

I was trying to install the appmarket-simple on a newly created Ubuntu 22.04.5. After a quick apt update && apt ugrade -y I follow the next steps:

Create symbolyc link to python (somehow it needed) and install make:

ln -s /usr/bin/python3 /usr/bin/python
apt install python2 build-essential -y

Install and use node 18 and npm 10, and then install yarn:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
source ~/.bashrc
nvm install 18
nvm use 18

node -v
npm -v

npm install -g yarn

Clone the repo:

git clone https://github.com/OpenNebula/appmarket-simple.git
cd appmarket-simple/src/public/react/

And finally:

yarn

There are a few warnings, I don't think they really matter, but over-communication is not that bad in this sites:

warning " > [email protected]" has unmet peer dependency "[email protected] - 3".
warning " > [email protected]" has unmet peer dependency "popper.js@^1.14.7".
warning " > [email protected]" has incorrect peer dependency "webpack@^3.0.0 || ^4.0.0".
warning "babel-jest > babel-preset-jest > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning " > [email protected]" has unmet peer dependency "@babel/core@^7.0.0".
warning "babel-jest > [email protected]" has unmet peer dependency "@babel/core@^7.0.0".
warning " > [email protected]" has incorrect peer dependency "webpack@^4.3.0".
warning " > [email protected]" has incorrect peer dependency "webpack@^4.0.0".
warning "webpack-dev-server > [email protected]" has incorrect peer dependency "webpack@^4.0.0".

But then, the error attacks:

In file included from ../../nan/nan.h:53,
                 from ../src/binding.cpp:1:
../src/binding.cpp: At global scope:
/root/.node-gyp/18.20.4/include/node/node.h:1014:7: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
 1014 |       (node::addon_register_func) (regfunc),                          \
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/.node-gyp/18.20.4/include/node/node.h:1048:3: note: in expansion of macro ‘NODE_MODULE_X’
 1048 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/binding.cpp:359:1: note: in expansion of macro ‘NODE_MODULE’
  359 | NODE_MODULE(binding, RegisterModule);
      | ^~~~~~~~~~~
make: *** [binding.target.mk:133: Release/obj.target/binding/src/binding.o] Error 1
make: Leaving directory '/root/appmarket-simple/src/public/react/node_modules/node-sass/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/root/appmarket-simple/src/public/react/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (node:events:517:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:292:12)
gyp ERR! System Linux 5.15.0-122-generic
gyp ERR! command "/root/.nvm/versions/node/v18.20.4/bin/node" "/root/appmarket-simple/src/public/react/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /root/appmarket-simple/src/public/react/node_modules/node-sass
gyp ERR! node -v v18.20.4
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Ok, after a few minutes reading, the thing is that the npm lilbrary node-sass is now deprecated and it says that we should instead use sass or sass-embedded. Ok, here we go:

nano /appmarket-simple/src/public/react/package.json

# And then delete the line referencing `node-sass` and add this one:
   "sass": "1.79.2"

It now pass the yarn phase, but when I try with yarn build I (obviosly) get:

> [email protected] build:css /root/appmarket-simple/src/public/react
> node-sass assets/scss/main.scss ../css/styles.css --output-style compressed

sh: 1: node-sass: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] build:css: `node-sass assets/scss/main.scss ../css/styles.css --output-style compressed`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] build:css script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2024-09-20T04_24_18_467Z-debug.log
error Command failed with exit code 1.

My knowledge on nodejs is not that high, as a matter of fact, is pretty low.

How can I solve this?

Thanks in advance.

EDIT:
I don't think it matters, but I'm trying this on a VM with 8GB of RAM, 4vCPU and a single virtual drive of 500GB, running inside an OpenNebula cluster.

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