javascript-tutorial/server

Server is running but SVG won't appear

EzequielCaste opened this issue · 7 comments

$ node -v
v11.14.0

OS is Windows 10, but managed to run some commands on GIT BASH.

Ok so server is running the translated cloned repo from es.javascript.info; when open with http://localhost:3000/coding-style (for example) there is a SVG file and this message appears:

/article/coding-style/code-style.svg: Could not execute GraphicsMagick/ImageMagick: identify "-ping" "-format" "{"width":%w,"height":%h}" "C:\Users\ezzep\js\server\public\en\article\coding-style\code-style.svg" this most likely means the gm/convert binaries can't be found

GraphicsMagick has been correctly installed and confirmed installation with the following command:

You have now installed GraphicsMagick. To test the installation select "Command Prompt" from the Windows Start menu. Within the window that appears type:
gm convert logo: logo.jpg
gm convert logo.jpg win:
and the GraphicsMagick logo should be displayed in a window.

GraphicsMagick logo appears OK

following instructions from https://github.com/javascript-tutorial/server

run command with BASH ./edit es
everything OK

Step 3. Run the translation task:

cd /js/server # in the server folder
# adjust NODE_LANG to your language
NODE_LANG=es glp engine:koa:tutorial:figuresTranslate

glp command not found, Replaced with npm run gulp --

NODE_LANG=es npm run gulp -- engine:koa:tutorial:figuresTranslate --image code-style.svg

> javascript-tutorial-server@2.0.0 gulp C:\Users\ezzep\js\server
> cross-env NODE_PRESERVE_SYMLINKS=1 NODE_PATH=./modules ./node_modules/.bin/gulp "engine:koa:tutorial:figuresTranslate" "--image" "code-style.svg"

[12:27:12] Using gulpfile ~\js\server\gulpfile.js
[12:27:12] Starting 'engine:koa:tutorial:figuresTranslate'...
Image 1-js/03-code-quality/02-coding-style/code-style.svg
[12:27:13] 'engine:koa:tutorial:figuresTranslate' errored after 638 ms
[12:27:13] Error: Command failed: convert -debug annotate xc: -font C:\Users\ezzep\js\server\modules\engine\koa\tutorial\resources\OpenSans-Bold.ttf -pointsize 14 -annotate 0 "No space" null: 2>&1
    at checkExecSyncError (child_process.js:630:11)
    at execSync (child_process.js:666:15)
    at pixelWidth (C:\Users\ezzep\js\server\modules\engine\koa\tutorial\lib\pixelWidth.js:11:16)
    at C:\Users\ezzep\js\server\modules\engine\koa\tutorial\tasks\figuresTranslate.js:156:31
    at String.replace (<anonymous>)
    at module.exports (C:\Users\ezzep\js\server\modules\engine\koa\tutorial\tasks\figuresTranslate.js:103:25)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! javascript-tutorial-server@2.0.0 gulp: `cross-env NODE_PRESERVE_SYMLINKS=1 NODE_PATH=./modules ./node_modules/.bin/gulp "engine:koa:tutorial:figuresTranslate" "--image" "code-style.svg"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the javascript-tutorial-server@2.0.0 gulp 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!     C:\Users\ezzep\AppData\Roaming\npm-cache\_logs\2020-08-14T15_27_13_429Z-debug.log
[2020-08-14T15_27_13_429Z-debug.log](https://github.com/javascript-tutorial/server/files/5075443/2020-08-14T15_27_13_429Z-debug.log)

ImageMagick, not GraphicsMagick =)

Ok then..

instructions were clear to install GraphicsMagick

(Maybe later, optional) If you're going to change images, please install GraphicsMagick.

Please try imagemagick? I'm not sure, but guess should be ImageMagick.

ok after installing imagemagick

[13:15:14] Finished 'engine:koa:tutorial:figuresTranslate' after 6.42 s

but localhost still shows

/article/coding-style/code-style.svg: Could not execute GraphicsMagick/ImageMagick: identify "-ping" "-format" "{"width":%w,"height":%h}" "C:\Users\ezzep\js\server\public\en\article\coding-style\code-style.svg" this most likely means the gm/convert binaries can't be found

Where is the "convert" utility and "identify"?

ok got it working! 🚀 🥳

First I had to uninstall GraphicsMagick and then install fresh the ImageMagick

image

now only thing left to to start translating the images.yml

Closing this for now, as the problem is solved. If not, let me know.