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

Add a description for installing GraphicsMagick or ImageMagick in docs/README.md #4045

Merged
merged 4 commits into from Nov 23, 2019

Conversation

HyunSangHan
Copy link
Contributor

@HyunSangHan HyunSangHan commented Oct 4, 2019

Description of the Change

To try to contribute to Mocha docs, I proceeded with the installation as described in README.md of docs directory. However, when I tried to use npm start docs after installing, the following error occurred:

nps is executing `docs.postbuild` : buildProduction docs/_site/index.html --outroot docs/_dist --canonicalroot https://mochajs.org/ --optimizeimages --svgo --inlinehtmlimage 9400 --inlinehtmlscript 0 --asyncscripts && cp docs/_headers docs/_dist/_headers && node scripts/netlify-headers.js >> docs/_dist/_headers
Guessing --root from input files: file:///Users/temp/Downloads/exercise2/mocha/docs/_site/
 ✔ 0.006 secs: logEvents
 ✔ 1.320 secs: loadAssets
 ✔ 0.008 secs: bundleWebpack
 ✔ 0.063 secs: populate
 ✔ 0.015 secs: bundleSystemJs
 ✔ 0.057 secs: bundleRequireJs
 ✔ 12.659 secs: populate
 ✔ 0.096 secs: populate
 ✔ 3.664 secs: checkIncompatibleTypes
 ✔ 0.020 secs: removeRelations
 ✔ 1.916 secs: populate
 ✔ 1.895 secs: populate
 ✔ 1.249 secs: removeRelations
 ✔ 1.766 secs: addDataVersionAttributeToHtmlElement
 ✔ 1.488 secs: stripDebug
 ✔ 2.555 secs: externalizeRelations
 ✔ 0.004 secs: mergeIdenticalAssets
objc[45255]: Class GNotificationCenterDelegate is implemented in both /Users/temp/Downloads/exercise2/mocha/node_modules/canvas/build/Release/libgio-2.0.0.dylib (0x105f31578) and /Users/temp/Downloads/exercise2/mocha/node_modules/sharp/vendor/lib/libgio-2.0.0.dylib (0x107bdf498). One of the two will be used. Which one is undefined.
 ✔ 0.274 secs: processImages
 ✔ 1.484 secs: spriteBackgroundImages
(node:45255) DeprecationWarning: max() is deprecated, use resize({ fit: "inside" }) instead
(node:45255) DeprecationWarning: withoutEnlargement() is deprecated, use resize({ withoutEnlargement: true }) instead
 ⚠ WARN: docs/_site/images/matomo-logo.png: Error executing Stream: The gm stream ended without emitting any data
(node:45255) UnhandledPromiseRejectionWarning: Error: docs/_site/images/matomo-logo.png: Error executing Stream: The gm stream ended without emitting any data
    at Socket.stdout.on.once (/Users/temp/Downloads/exercise2/mocha/node_modules/express-processimage/lib/getFilterInfosAndTargetContentTypeFromQueryString.js:821:31)
    at Object.onceWrapper (events.js:286:20)
    at Socket.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:45255) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:45255) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
cp: docs/_dist/_headers: No such file or directory
The script called "docs.postbuild" which runs "buildProduction docs/_site/index.html --outroot docs/_dist --canonicalroot https://mochajs.org/ --optimizeimages --svgo --inlinehtmlimage 9400 --inlinehtmlscript 0 --asyncscripts && cp docs/_headers docs/_dist/_headers && node scripts/netlify-headers.js >> docs/_dist/_headers" failed with exit code 1 https://github.com/kentcdodds/nps/blob/v5.9.5/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
The script called "docs" which runs "nps docs.prebuild && nps docs.api && eleventy && nps docs.linkcheck && nps docs.postbuild" failed with exit code 1 https://github.com/kentcdodds/nps/blob/v5.9.5/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mocha@6.2.0 start: `nps "docs"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mocha@6.2.0 start 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!     /Users/temp/.npm/_logs/2019-10-03T08_45_45_219Z-debug.log

After searching, I installed GraphicsMagick and finally I was able to make it work. It is understood that GraphicsMagick must be installed for execution, but I believe there is not enough explanation about it. Therefore, I think some additional description of this case can be more helpful for beginners(like me!). I propose to add the description as follows:

  • If you get the error message below when running npm start docs, follow this guide to install GraphicsMagick.
⚠ WARN: docs/_site/images/matomo-logo.png: Error executing Stream: The gm stream ended without emitting any data
(node:45255) UnhandledPromiseRejectionWarning: Error: docs/_site/images/matomo-logo.png: Error executing Stream: The gm stream ended without emitting any data
    at Socket.stdout.on.once (/Users/username/mocha/node_modules/express-processimage/lib/getFilterInfosAndTargetContentTypeFromQueryString.js:821:31)
    at Object.onceWrapper (events.js:286:20)
    at Socket.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:45255) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:45255) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
cp: docs/_dist/_headers: No such file or directory

Benefits

I believe it can be more helpful for beginners.

Copy link
Member

@outsideris outsideris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. I saw gm errors when I was building docs.
I talked about this, see https://gitter.im/mochajs/contributors?at=5d55623f7d56bc60805a72a8

docs/README.md Outdated
@@ -19,6 +19,21 @@ _So you wanna build the site?_
- The content lives in `docs/index.md`; everything else is markup, scripts, assets, etc.
- This file (`docs/README.md`) should _not_ be included in the build.
- `docs/_dist` is where the deployed site lives. `docs/_site` is essentially a build step. These directories are _not_ under version control.
- If you get the error message below when running `npm start docs`, follow [this guide](https://www.npmjs.com/package/gm) to install GraphicsMagick.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about GraphicsMagick or ImageMagick. I think both are work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your opinion! I'll check and fix it. :-)

@outsideris outsideris added the area: documentation anything involving docs or mochajs.org label Oct 4, 2019
@HyunSangHan HyunSangHan changed the title Add a description about installing GraphicsMagick in README of docs Add a description for installing GraphicsMagick or ImageMagick in docs/README.md Oct 4, 2019
@craigtaub craigtaub merged commit 2e816fe into mochajs:master Nov 23, 2019
@craigtaub craigtaub added this to the next milestone Nov 23, 2019
@juergba juergba modified the milestones: next, v7.0.0 Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: documentation anything involving docs or mochajs.org
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants