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

During docker build: Syntax error: "(" unexpected #350

Open
maltebeckmann opened this issue Oct 27, 2020 · 5 comments
Open

During docker build: Syntax error: "(" unexpected #350

maltebeckmann opened this issue Oct 27, 2020 · 5 comments

Comments

@maltebeckmann
Copy link

Ran into this error while running docker build for a project locally on OS X. I read in a perhaps somewhat related thread that local OS X dependencies can mix with the files that are compiled during the docker build command so I ran $ npm uninstall -g npm on my local machine. Has anyone else run into this?

[21:03:32] Using gulpfile /app/gulpfile.js
[21:03:32] Starting 'generate-assets'...
[21:03:32] Starting 'styles'...
[21:03:32] Starting 'scripts'...
[21:03:32] Starting 'vendorScripts'...
[21:03:32] Starting 'imgCompression'...
[21:03:33] Finished 'scripts' after 303 ms
[21:03:33] 'imgCompression' errored after 306 ms
[21:03:33] Error in plugin "gulp-imagemin"
Message:
/app/node_modules/optipng-bin/vendor/optipng: 1: /app/node_modules/optipng-bin/vendor/optipng: Syntax error: "(" unexpected

Details:
code: 2
killed: false
stdout:
stderr: /app/node_modules/optipng-bin/vendor/optipng: 1: /app/node_modules/optipng-bin/vendor/optipng: Syntax error: "(" unexpected

failed: true
signal: null
cmd: /app/node_modules/optipng-bin/vendor/optipng -strip all -clobber -fix -o 3 -out /tmp/d41e4654-da3c-4094-9b45-b2b08389e429 /tmp/9b181e38-4179-42c2-8c69-75bcb1320b5e
timedOut: false
fileName: /app/clientsite/static/images/clientsite_logo_500_500_red.png
domainEmitter: [object Object]
domain: [object Object]
domainThrown: false

[21:03:33] 'generate-assets' errored after 313 ms
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: gulp generate-assets
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build 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/2020-10-27T21_03_33_133Z-debug.log

@maltebeckmann
Copy link
Author

maltebeckmann commented Oct 27, 2020

Tried uninstalling/rebuilding/installing ... gulp-imagemin, node-gyp, ... didn't help.

On node 13.1.0 and npm 6.14.8

@boxpositron
Copy link

I have this exact issue.

@boxpositron
Copy link

boxpositron commented Dec 7, 2020

    Command failed: /parking/node_modules/optipng-bin/vendor/optipng -strip all -clobber -o 3 -out /tmp/1c39dcda-7ef1-49ba-bfdf-3d807a9105fd -fix /tmp/e0ccd238-8de2-445f-9e7b-9856392e0441
/parking/node_modules/optipng-bin/vendor/optipng: 1: /parking/node_modules/optipng-bin/vendor/optipng: Syntax error: "(" unexpected


Details:
    code: 2
    killed: false
    stdout: 
    stderr: /parking/node_modules/optipng-bin/vendor/optipng: 1: /parking/node_modules/optipng-bin/vendor/optipng: Syntax error: "(" unexpected

    failed: true
    signal: null
    cmd: /parking/node_modules/optipng-bin/vendor/optipng -strip all -clobber -o 3 -out /tmp/1c39dcda-7ef1-49ba-bfdf-3d807a9105fd -fix /tmp/e0ccd238-8de2-445f-9e7b-9856392e0441
    timedOut: false
    fileName: /parking/public/images/400.png
    domainEmitter: [object Object]
    domainThrown: false

@drichfield
Copy link

In my case it was simply because i had previously run an npm install on my local machine in the same app that I'm building the image from. The Dockerfile was setup to copy the entire repo into the image, which in my case, included node_modules. Deleting it before building the image and then adding a .dockerignore with the node_modules exclusion solves it.

@hyunhoRIDI
Copy link

In my case it was simply because i had previously run an npm install on my local machine in the same app that I'm building the image from. The Dockerfile was setup to copy the entire repo into the image, which in my case, included node_modules. Deleting it before building the image and then adding a .dockerignore with the node_modules exclusion solves it.

amazing. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants