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 install Bedrock due to node-gyp errors #427

Open
netsensei opened this issue Feb 3, 2022 · 2 comments
Open

Can't install Bedrock due to node-gyp errors #427

netsensei opened this issue Feb 3, 2022 · 2 comments

Comments

@netsensei
Copy link

Hi!

I'm trying to set up Bedrock per the installation instructions, but npm install is failing with this error message:

> [email protected] install /home/netsensei/Workspace/my-bedrock-project/node_modules/ttf2woff2
> (node-gyp rebuild > builderror.log) || (exit 0)
                                                                               
../csrc/addon.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE convert(Nan::NAN_METHOD_ARGS_TYPE)’:                                                                                                                                                                                                                               
../csrc/addon.cc:10:48: error: no matching function for call to ‘v8::Value::ToObject()’
   10 |   Local<Object> inputBuffer = info[0]->ToObject();
      |                               ~~~~~~~~~~~~~~~~~^~
In file included from /home/netsensei/.cache/node-gyp/14.15.0/include/node/node.h:67,
                 from ../../nan/nan.h:56,
                 from ../csrc/addon.cc:1:
/home/netsensei/.cache/node-gyp/14.15.0/include/node/v8.h:2822:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
 2822 |   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
      |                                            ^~~~~~~~
/home/netsensei/.cache/node-gyp/14.15.0/include/node/v8.h:2822:44: note:   candidate expects 1 argument, 0 provided
make: *** [addon.target.mk:137: Release/obj.target/addon/csrc/addon.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/netsensei/.nvm/versions/node/v14.15.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Linux 5.15.16-100.fc34.x86_64
gyp ERR! command "/home/netsensei/.nvm/versions/node/v14.15.0/bin/node" "/home/netsensei/.nvm/versions/node/v14.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/netsensei/Workspace/my-bedrock-project/node_modules/ttf2woff2
gyp ERR! node -v v14.15.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 

Steps to reproduce

I'm on Fedora 34. But I've also tried this inside a Docker container based off node:14 (node v14.19.0) and on Vercel as well. In all instances, I'm ending up with the above failure.

  1. I'm using nvm so I've installed v14.15.0 per the .nvmrc file: nvm install v14.15.0
  2. npx degit usebedrock/bedrock my-bedrock-project
  3. cd my-bedrock-project
  4. npm instal => failure

I've also tried using different Node versions (15, 16) but to no avail.

We have an prototype based on an earlier version of Bedrock (v1.28) which yields the exact same error at this moment. So, we currently can't run this as well.

Any ideas on what's going wrong here? Thanks!

@netsensei
Copy link
Author

netsensei commented Feb 3, 2022

Okay, I've narrowed this down. This is caused by issues with outdated dependencies in package-lock.json. When I delete the file, and just do npm install. Everything gets installed correctly.

Unrelated:

As for the prototype, there's a package called webfonts-generator in package.json which is the culprit, and triggers the above error as it tries to install an older version of node-gyp (3.8.0) which is incompatible with node 14.

Try this

nvm use v14.15.0
mkdir foobar && cd foobar
npm init
npm install webfonts-generator  # breaks

Edit: turns out icon-fonts-generator in our project isn't supported anymore because of this issue: Workshape/icon-font-generator#73 Strange that it only pops up now.

edit2: I've solved the issue in our prototype project with icon-fonts-generator by swapping it for fantasticon.

@Wolfr
Copy link
Contributor

Wolfr commented Feb 3, 2022

Thanks for reporting this, glad you could solve the issue!

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

2 participants