Generator: Installation wont work with version 0.7.0 and up

Created on 29 May 2019  Â·  16Comments  Â·  Source: asyncapi/generator

Os : macOs 10.14.15
node : v12.3.1

Installation doesn't work with version 0.7.0. the last version to work is 0.6.7


make: * [Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:200:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/Cellar/node/12.3.1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/asyncapi-generator/node_modules/ref
gyp ERR! node -v v12.3.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install 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:

bug

All 16 comments

Seems a problem with the compilation process. Can you make sure you have everything you need to build native modules? Check this out: https://github.com/nodejs/node-gyp#on-macos.

I have the same issue with node version 12.3.x

With version node v10.16.0 works good 🤔

Everything seem in order for compilation.

It looks like a breaking change in latest Node.js native addons. Can someone help with this bug? I have little to no time lately to debug.

Seems issue is with asyncapi-parser package. If it is removed from package.json then npm i is ok for node version 12.3.x 🤔

Yeah, as a hint, the asyncapi-parser package is a C++ version of the Go one and it's imported in Node.js using ffi.

@derberg can you have a look at this bug? Seems that node-ffi is not compatible with Node.js v12.

on it 👀

I have Mac 10.14.4 and I'm super old and use old Node :) version 8.16.0 and NPM 6.4.1
I installed generator with npm install -g asyncapi-generator
Then I took this spec:

asyncapi: '2.0.0-rc1'
id: 'urn:com:ec:stage:server'
info:
  title: ec-all-events
  version: v1
  description: EC Events v1
channels:
  customer.created.v1:
    subscribe:
      summary: Customer Register Event v2
      message:
        payload:
          type: object
          required:
          - storeUid
          - customerId
          - customerUid
          properties:
            customerUid:
              type: string
              example: [email protected]
              description: Email of a Customer
              title: Customer uid
            storeUid:
              type: string
              example: 4caad296
              description: Unique id of a Store
              title: StoreUid
            customerId:
              type: string
              example: 0ed118f9474e
              description: Unique id of a Customer
              title: Customer uid
  quote.orderplaced.v1:
    subscribe:
      summary: Order Placed for Quote Event v1
      message:
        payload:
          type: object
          required:
          - quoteCode
          - orderCode
          properties:
            quoteCode:
              type: string
              example: '76272727'
              description: Code of Quote
              title: Quote Code
            orderCode:
              type: string
              example: '76272727'
              description: Code of Order
              title: Order Code
  quote.expiresoonevent.v1:
    subscribe:
      summary: Quote Expiring Soon Event v1
      message:
        payload:
          type: object
          required:
          - quoteCode
          - quoteUserUid
          - quoteUserType
          - storeUid
          - customerUid
          properties:
            customerUid:
              type: string
              example: [email protected]
              description: Email Address of Customer
              title: Customer ID
            storeUid:
              type: string
              example: 4caad296
              description: ID of the Store (BaseStore)
              title: Store ID
            quoteCode:
              type: string
              example: '76272727'
              description: Code of Quote
              title: Quote Code
            quoteUserUid:
              type: string
              example: [email protected]
              description: ID Of User Canceling Quote
              title: ID Of User
            quoteUserType:
              type: string
              example: BUYER
              description: User Type
              title: User Type

And I did ag asyncApiSpec.yaml markdown and the result is:

Done! ✨
Check out your shiny new generated files at /Users/i303812/Desktop.`

I will try now with older Node versions and dig deeper

I think the problem appears on Node.js 12.

yeap, with latest Node v12.4.0 installation fails

of course, installing asyncapi-parser also fails. I checked node-ffi and there is another issue about lack of support for node 12.x https://github.com/node-ffi/node-ffi/issues/545 and PR to fix it is already there https://github.com/node-ffi/node-ffi/pull/544. Problem is that node-ffi seems pretty abandoned to me as the main contributor TooTallNate did not make any single comment under any issue in the project since last release in January. And even January release was already a headache https://github.com/node-ffi/node-ffi/issues/465#issuecomment-455110727. I checked Node 11.15 and installation works.

Looking at the current status of the project, I'm not sure you can do anything else than just write in the readme of the generator that versions greater than 11 are not supported at the moment.

What do you think?

I see. I think we're seeing many reasons to have a separate implementation of the JS (Browser and Node.js) parser. Let's discuss this later tomorrow on the public meeting. Thanks for investigating mate.

Outcome of Tuesday meeting is that we should check how the WebAssembly will work for frontend and if all is nice, we could explore its usage in Node as a replacement of node-ffi -> https://github.com/asyncapi/asyncapi-react/issues/47

This shouldn't be a problem anymore since we got rid of the C++ parser. Closing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fmvilas picture fmvilas  Â·  8Comments

derberg picture derberg  Â·  8Comments

jonaslagoni picture jonaslagoni  Â·  5Comments

ymarillet picture ymarillet  Â·  9Comments

jonaslagoni picture jonaslagoni  Â·  4Comments