asyncapi / html-template

HTML template for AsyncAPI Generator. Use it to generate a static docs. It is using AsyncAPI React component under the hood.
64 stars 56 forks source link

cross-env: not found #151

Closed briggySmalls closed 3 years ago

briggySmalls commented 3 years ago

Describe the bug

cross-env is not installed as a dependency of @asyncapi/html-template, nor is it listed as a peer dependency or anything like that.

We've been using the asyncapi/generator image with the @asyncapi/html-template in our CI pipeline for some time.

The command we execute is:

ag -o path/to/output/dir ./path/to/spec.yml @asyncapi/html-template

Today it started failing with:

> @asyncapi/html-template@0.17.2 generate:atomcss /usr/local/lib/node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template
> cross-env NODE_ENV=production postcss template/css/atom-one-dark.min.css -o template/css/main.min.css

sh: cross-env: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! @asyncapi/html-template@0.17.2 generate:atomcss: `cross-env NODE_ENV=production postcss template/css/atom-one-dark.min.css -o template/css/main.min.css`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the @asyncapi/html-template@0.17.2 generate:atomcss 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/2021-02-16T10_31_46_618Z-debug.log
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.1 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

Something went wrong:
Error: @asyncapi/html-template@0.17.2 postinstall: `rimraf "template/css/main.min.css" && npm run generate:atomcss && npm run generate:maincss && npm run generate:tailwind.css`
Exit status 1
    at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
    at EventEmitter.emit (events.js:315:20)
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1048:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)

How to Reproduce

docker run --rm -it --entrypoint="" asyncapi/generator npm i -g @asyncapi/html-template

Expected behavior

When using @asyncapi/html-template as a paramter to ag for the command to succeed.

github-actions[bot] commented 3 years ago

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.

Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

derberg commented 3 years ago

This is how you learn you have users 😭 sorry folks, PR opened already

briggySmalls commented 3 years ago

Thanks for your speedy fix! And thanks for the project, we really value it on my project :)

derberg commented 3 years ago

@briggySmalls thanks a lot for pointing out the problem and yeah, still liking us even though we caused the failure 🙇🏼