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

Problem with updating dependencies #64

Closed
mpluta-airhelp opened this issue Feb 25, 2019 · 5 comments
Closed

Problem with updating dependencies #64

mpluta-airhelp opened this issue Feb 25, 2019 · 5 comments

Comments

@mpluta-airhelp
Copy link

What did you do?

I following Dockerfile I changed only version of galen dependency from 2.3.7 to 2.4.0
I wanted to build Dockerfile with updated dept:

FROM java:8

ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 6.11.4
ENV GALEN_VERSION 2.4.0


# Install nvm with node and npm
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash \
    && . $NVM_DIR/nvm.sh \
    && nvm install $NODE_VERSION \
    && nvm alias default $NODE_VERSION \
    && nvm use default \
    && npm install -g galenframework-cli@$GALEN_VERSION --verbose


ENV NODE_PATH      $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules
ENV PATH           $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH

RUN mkdir -p /usr/src/galen
WORKDIR /usr/src/galen

What did you expect to happen?

After running docker build . I expect it to run it succesfully.

What happened instead?

This:

> galenframework@2.4.0 postinstall /usr/local/nvm/versions/node/v6.11.4/lib/node_modules/galenframework-cli/node_modules/galenframework
> node postinstall.js

/usr/local/nvm/versions/node/v6.11.4/lib/node_modules/galenframework-cli/node_modules/sntp/lib/index.js:19
exports.time = async function (options = {}) {
                     ^^^^^^^^

SyntaxError: Unexpected token function
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/nvm/versions/node/v6.11.4/lib/node_modules/galenframework-cli/node_modules/hawk/lib/index.js:5:16)
npm verb lifecycle galenframework@2.4.0~postinstall: unsafe-perm in lifecycle false
npm verb lifecycle galenframework@2.4.0~postinstall: PATH: /usr/local/nvm/versions/node/v6.11.4/lib/node_modules/npm/bin/node-gyp-bin:/usr/local/nvm/versions/node/v6.11.4/lib/node_modules/galenframework-cli/node_modules/galenframework/node_modules/.bin:/usr/local/nvm/versions/node/v6.11.4/lib/node_modules/galenframework-cli/node_modules/.bin:/usr/local/nvm/versions/node/v6.11.4/lib/node_modules/.bin:/usr/local/nvm/versions/node/v6.11.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
npm verb lifecycle galenframework@2.4.0~postinstall: CWD: /usr/local/nvm/versions/node/v6.11.4/lib/node_modules/galenframework-cli/node_modules/galenframework
npm info lifecycle galenframework@2.4.0~postinstall: Failed to exec postinstall script
npm verb unlock done using /root/.npm/_locks/staging-a87420dfc4fc3cda.lock for /usr/local/nvm/versions/node/v6.11.4/lib/node_modules/.staging
/usr/local/nvm/versions/node/v6.11.4/lib
└── (empty)

npm verb stack Error: galenframework@2.4.0 postinstall: `node postinstall.js`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> (/usr/local/nvm/versions/node/v6.11.4/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
npm verb stack     at emitTwo (events.js:106:13)
npm verb stack     at EventEmitter.emit (events.js:191:7)
npm verb stack     at ChildProcess.<anonymous> (/usr/local/nvm/versions/node/v6.11.4/lib/node_modules/npm/lib/utils/spawn.js:40:14)
npm verb stack     at emitTwo (events.js:106:13)
npm verb stack     at ChildProcess.emit (events.js:191:7)
npm verb stack     at maybeClose (internal/child_process.js:920:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
npm verb pkgid galenframework@2.4.0
npm verb cwd /
npm ERR! Linux 4.9.125-linuxkit
npm ERR! argv "/usr/local/nvm/versions/node/v6.11.4/bin/node" "/usr/local/nvm/versions/node/v6.11.4/bin/npm" "install" "-g" "galenframework-cli@2.4.0" "--verbose"
npm ERR! node v6.11.4
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! galenframework@2.4.0 postinstall: `node postinstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the galenframework@2.4.0 postinstall script 'node postinstall.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the galenframework package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node postinstall.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs galenframework
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls galenframework
npm ERR! There is likely additional logging output above.
npm verb exit [ 1, true ]

npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log
npm ERR! code 1

Your Environment

Galen version: 2.4.0
Java version: 8
NodeJS and NPM version: 6.11.4/3.10.10
Platform(s) running Galen: Docker :P

@mpluta-airhelp
Copy link
Author

Using version 8.15.0 of nodej with npm 6.4.1 causes errors with installing chromedriver...

@hypery2k
Copy link
Owner

Why didn't you use the preconfigured docker image?

https://hub.docker.com/r/galenframework/cli/

@mpluta-airhelp
Copy link
Author

We are using selenium grid to launch tests and so fair share of dependencies in the Dockerfile are not used by us.

@hypery2k
Copy link
Owner

hypery2k commented Mar 1, 2019

you need at least NodeJS 8 to run this. NodeJS 6 is out of support

@hypery2k hypery2k closed this as completed Mar 1, 2019
@mpluta-airhelp
Copy link
Author

Closing notes:
it seems changing shell to bash did the trick :) go figure... And so my Dockerfile for use with grid looks like this now:

FROM openjdk:8-jre

ENV NODE_VERSION 8.12.0
ENV GALEN_VERSION 2.4.3
ENV NVM_DIR /home/galen
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH      $NVM_DIR/v$NODE_VERSION/bin:$PATH

RUN apt-get -qqy update \
  && apt-get -qqy --no-install-recommends install 

#========================================
# Add normal user with passwordless sudo
#========================================
RUN useradd galen \
         --shell /bin/bash  \
         --create-home \
  && usermod -a -G sudo galen \
  && echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers \
  && echo 'galen:secret' | chpasswd

USER galen
#===================================================
# Install nvm with node and npm
#===================================================
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash \
    && . $NVM_DIR/nvm.sh \
    && nvm install $NODE_VERSION \
    && nvm alias default $NODE_VERSION \
    && nvm use default \
    && npm install -g galenframework-cli@$GALEN_VERSION```

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