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

node-gyp build error (syntax error) #187

Open
CRH380B-6216L opened this issue Jul 16, 2020 · 1 comment
Open

node-gyp build error (syntax error) #187

CRH380B-6216L opened this issue Jul 16, 2020 · 1 comment

Comments

@CRH380B-6216L
Copy link

CRH380B-6216L commented Jul 16, 2020

I am trying to build gzweb inside a docker image But there's a problem during building it

/root/gzweb/node_modules/env-paths/index.js:7
const {env} = process;
      ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/root/gzweb/node_modules/node-gyp/bin/node-gyp.js:7:18)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
There are node-gyp build errors, exiting.

I am trying to build gzweb inside an instance first after copied the code at branch gzweb_1.4.0 and occurred the syntax error in node-gyp build step. My Dockerfile works like below:

FROM ros:kinetic-robot

# Install gazebo packages
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D2486D2DD83DB69272AFE98867170598AF249743 && \
    echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list && \	
    apt-get update && \
    apt-get install -y --no-install-recommends \
        ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-ros-control && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* 

# Install gzweb dependent packages
RUN apt-get update && \
    apt-get purge -y git && \
    apt-get install -y \
        libjansson-dev nodejs npm nodejs-legacy libboost-dev imagemagick libtinyxml-dev mercurial cmake build-essential git && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* 
	
# clone gzweb
ENV GZWEB_WS /root/gzweb
ADD gzweb_1.4.0 $GZWEB_WS
WORKDIR $GZWEB_WS
@judyanndixon
Copy link

Maybe this will resolve your issue too. osrf/docker_images#334

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

2 participants