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

meteor 2.4 install: chown: missing operand after '/home/.meteor' #11694

Closed
Floriferous opened this issue Oct 13, 2021 · 7 comments
Closed

meteor 2.4 install: chown: missing operand after '/home/.meteor' #11694

Floriferous opened this issue Oct 13, 2021 · 7 comments

Comments

@Floriferous
Copy link
Member

@Floriferous Floriferous commented Oct 13, 2021

I'm trying to install meteor 2.4 in a Dockerfile, but I'm getting the following error:

#6 68.18 > meteor@2.4.1 install /usr/local/lib/node_modules/meteor
#6 68.18 > node cli.js install
#6 68.18 
#6 104.7 => Meteor Downloaded in 36.369s
#6 104.7 => Extracting the tarball, this may take some time
#6 119.9 => Meteor extracted in 15.181s
#6 119.9 chown: missing operand after '/home/.meteor'
#6 119.9 Try 'chown --help' for more information.
#6 119.9 /usr/local/lib/node_modules/meteor/install.js:29
#6 119.9   throw err;
#6 119.9   ^
#6 119.9 
#6 119.9 Error: Command failed: chown -R  "/home/.meteor"
#6 119.9 chown: missing operand after '/home/.meteor'
#6 119.9 Try 'chown --help' for more information.
#6 119.9 
#6 119.9     at checkExecSyncError (child_process.js:640:11)
#6 119.9     at Object.execSync (child_process.js:676:15)
#6 119.9     at setupExecPath (/usr/local/lib/node_modules/meteor/install.js:234:17)
#6 119.9     at async setup (/usr/local/lib/node_modules/meteor/install.js:208:3)
#6 119.9     at async b.<anonymous> (/usr/local/lib/node_modules/meteor/install.js:138:5) {

The Dockerfile is as follows:

ARG METEOR_NPM_VERSION=2.4.1
ARG NODE_VERSION=14.17.3

FROM cypress/base:$NODE_VERSION

RUN true \
  # Install dependencies (apt).
  && apt-get update \
  && apt-get install --no-install-recommends -y \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release \
    netcat \
    python-pip \
    python-setuptools \
  # Install dependencies (npm).
  && npm install --no-audit --global --unsafe-perm \
    meteor@$METEOR_NPM_VERSION 

Any idea what might be going on here?

@Floriferous
Copy link
Member Author

@Floriferous Floriferous commented Oct 13, 2021

This happens when installing meteor via npm on CircleCI as well.

@menewman
Copy link
Contributor

@menewman menewman commented Oct 13, 2021

@Floriferous - We recently went through the exercise of figuring out how to install Meteor via NPM on CircleCI and ran into a couple of small bumps. I wrote a little more context here that might be relevant to you?

https://forums.meteor.com/t/ci-script-installing-meteor-fails/56823/2?u=menewman

I don't know if the fact that you're trying to install a particular pinned version of Meteor makes a difference, and our investigation was purely for CircleCI (not for Dockerfiles in general).

@renanccastro
Copy link
Contributor

@renanccastro renanccastro commented Oct 13, 2021

Hi @Floriferous . The NPM installer doesn't support root installation without sudo.

I've put together a docker image that you can use in all your CI's if you want to!

meteor/meteor-base:latest
The source-file is here: https://github.com/meteor/galaxy-images/tree/master/meteor-base

@Floriferous
Copy link
Member Author

@Floriferous Floriferous commented Oct 14, 2021

Is there already an open issue to make this work better? I was really hoping that the move to npm would make meteor easier to use, not harder..

npm i -g meteor should really work everywhere without any issues.

@renanccastro
Copy link
Contributor

@renanccastro renanccastro commented Oct 14, 2021

@Floriferous, Meteor is not meant to run as root, and thus I don't think the install script should support this flow. But we are open to debate, for sure. What are the advantages of running as root compared to configuring a normal user on docker?

Have you taken a look at the image I've shared? It's really easy to use.

@StrictlySkyler
Copy link

@StrictlySkyler StrictlySkyler commented Oct 16, 2021

Two reasons I can think of why this should work as root:

  1. Using the curl https://install.meteor.com/ | sh script works as root without issue, so feature parity for the npm method should not cause a failure here
  2. Forcing this change breaks existing build pipelines with a very opinionated way regarding how docker images are built and how Meteor should be used

Isn't Meteor meant to be "batteries included but removable"? Would it make more sense for this to log a warning rather than to fail the build?

StrictlySkyler added a commit to StrictlySkyler/meteor-environment that referenced this issue Oct 17, 2021
@renanccastro
Copy link
Contributor

@renanccastro renanccastro commented Nov 30, 2021

Hello, everyone.

Root install support was added to latest npm installer.

Let me know if you find any trouble with it

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

Successfully merging a pull request may close this issue.

None yet
5 participants