-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
AsyncAPI Code Generator not working on Windows #287
Comments
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue. |
@jschabowsky can you please try
|
Looks like the same result: C:\Users\jschabowsky\Downloads\test>npm cache clear --force C:\Users\jschabowsky\Downloads\test>ag ..\COVID19PopulationProvider.yaml @asyncapi/markdown-template -o output Something went wrong: C:\Users\jschabowsky\Downloads\test> |
Hey @jschabowsky Given your AsyncAPI document {
"asyncapi": "2.0.0",
"info": {
"title": "Streetlights API",
"version": "1.0.0",
"description": "The Smartylighting Streetlights API allows you\nto remotely manage the city lights.\n",
"license": {
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0"
}
},
"servers": {
"mosquitto": {
"url": "mqtt://test.mosquitto.org",
"protocol": "mqtt"
}
},
"channels": {
"light/measured": {
"publish": {
"summary": "Inform about environmental lighting conditions for a particular streetlight.",
"operationId": "onLightMeasured",
"message": {
"payload": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"minimum": 0,
"description": "Id of the streetlight."
},
"lumens": {
"type": "integer",
"minimum": 0,
"description": "Light intensity measured in lumens."
},
"sentAt": {
"type": "string",
"format": "date-time",
"description": "Date and time when the message was sent."
}
}
}
}
}
}
}
} I was able to use it right off the bat
Versions I am using:
I have tried clear cache, prune npm etc to have clear workspace as well, however I cannot reproduce this problem. My suggestion try deleting the generated |
@jonaslagoni the issue seems to be with the latest LTS version, Good news is I managed to reproduce 🎆 I don't know yet how to fix but I got a Windows VM on my local, installed fresh Node.js 12.16.1, upgraded npm to latest 6.14.4 and performed fresh installation of the latest generator and this is why I get at first run attempt:
same error, different package |
On the same subject, Shouldnt there be a prereq check when running our generator? In other words, if "strange behaviors" happen because your using too old of a version of npm/node, shouldnt that check be perform and a warning/error be presented to the user to upgrade in order to successfully generate code? Else I fear this is going to be a very common issue? Thoughts? |
@jschabowsky I actually like the idea a lot and I think npm already supports it with https://docs.npmjs.com/files/package.json#engines. I'll add this to package.json when I will work on a fix for this issue |
@jschabowsky the issue is fixed, I cannot reproduce it anymore on my Windows VM. Please run The |
🎉 This issue has been resolved in version 0.36.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Multiple users are having an issue with the code generator.
Specifically on windows. If we use the following example:
asyncapi: '2.0.0'
info:
title: Streetlights API
version: '1.0.0'
description: |
The Smartylighting Streetlights API allows you
to remotely manage the city lights.
license:
name: Apache 2.0
url: 'https://www.apache.org/licenses/LICENSE-2.0'
servers:
mosquitto:
url: mqtt://test.mosquitto.org
protocol: mqtt
channels:
light/measured:
publish:
summary: Inform about environmental lighting conditions for a particular streetlight.
operationId: onLightMeasured
message:
payload:
type: object
properties:
id:
type: integer
minimum: 0
description: Id of the streetlight.
lumens:
type: integer
minimum: 0
description: Light intensity measured in lumens.
sentAt:
type: string
format: date-time
description: Date and time when the message was sent.
run: ag ..<filename> @asyncapi/markdown-template -o output
The result is as follows:
npm http fetch GET 200 https://registry.npmjs.org/@asyncapi%2fmarkdown-template 962ms
npm http fetch GET 200 https://registry.npmjs.org/@asyncapi/markdown-template/-/markdown-template-0.3.0.tgz 527ms
npm http fetch GET 304 https://registry.npmjs.org/markdown-it 468ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/markdown-it/-/markdown-it-10.0.0.tgz 363ms
npm http fetch GET 200 https://registry.npmjs.org/openapi-sampler 1041ms
npm http fetch GET 304 https://registry.npmjs.org/argparse 311ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/entities 368ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/entities/-/entities-2.0.0.tgz 151ms
npm http fetch GET 304 https://registry.npmjs.org/uc.micro 618ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/mdurl 650ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/linkify-it 694ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/sprintf-js 90ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/json-pointer 107ms
npm http fetch GET 200 https://registry.npmjs.org/foreach 116ms
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\jschabowsky\Downloads\test\package.json'
npm WARN . No description
npm WARN . No repository field.
npm WARN . No README data
npm WARN . No license field.
Something went wrong:
Error: invalid bin entry for package [email protected]. key=markdown-it, value=bin/markdown-it.js
at C:\Program Files\nodejs\node_modules\npm\node_modules\bin-links\index.js:86:13
at tryCatcher (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
at MappingPromiseArray._promiseFulfilled (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\map.js:61:38)
at MappingPromiseArray.PromiseArray._iterate (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise_array.js:114:31)
at MappingPromiseArray.init (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise_array.js:78:10)
at MappingPromiseArray._asyncInit (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\map.js:30:10)
at _drainQueueStep (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:142:12)
at _drainQueue (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:131:9)
at Async._drainQueues (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:147:5)
at Immediate.Async.drainQueues [as _onImmediate] (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
This only is happening on windows and NOT on Mac.
This was reproduced on multiple windows machines.
To fix tried:
npm install -g npm@latest
npm prune
None of those commands changes the output.
Version of AsyncAPI Generator: 0.36.3
The text was updated successfully, but these errors were encountered: