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

Installing Node on "executor: machine" fails #62

Closed
bahmutov opened this issue Oct 22, 2020 · 3 comments · Fixed by #72
Closed

Installing Node on "executor: machine" fails #62

bahmutov opened this issue Oct 22, 2020 · 3 comments · Fixed by #72
Assignees
Labels
bug Something isn't working

Comments

@bahmutov
Copy link

Orb version:

4.1.0

What happened:

https://app.circleci.com/pipelines/github/cypress-io/cypress-docker-images/343/workflows/a16f93ea-cf0f-4934-9c6f-55292f3219d0/jobs/21538

Trying to install Node lts on the Circle machine

- node/install:
    lts: true

Fails with the following error message

npm ERR! peer dep missing: eslint@>=3.1.0, required by eslint-plugin-node@5.2.0

Full error

#!/bin/bash -eo pipefail
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
NVM_DIR="$HOME/.nvm"
echo "export NVM_DIR=\"$HOME/.nvm\"" >> $BASH_ENV
echo "[ -s \"$NVM_DIR/nvm.sh\" ] && \. \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV
source $BASH_ENV
nvm install \
  --lts 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13527  100 13527    0     0   102k      0 --:--:-- --:--:-- --:--:--  102k
=> nvm is already installed in /opt/circleci/.nvm, trying to update using git
=> => Compressing and cleaning up git repository

=> nvm source string already in /home/circleci/.bashrc
=> Appending bash_completion source string to /home/circleci/.bashrc
npm ERR! peer dep missing: eslint@>=3.1.0, required by eslint-plugin-node@5.2.0
=> You currently have modules installed globally with `npm`. These will no
=> longer be linked to the active version of Node when you install a new node
=> with `nvm`; and they may (depending on how you construct your `$PATH`)
=> override the binaries of modules installed with `nvm`:

/opt/circleci/.nvm/versions/node/v6.1.0/lib
├── bower@1.8.2
├── coffee-script@1.12.7
├── grunt@1.0.1
├── grunt-cli@1.2.0
├── mocha@4.0.0
├── nodeunit@0.11.1
=> If you wish to uninstall them at a later point (or re-install them under your
=> `nvm` Nodes), you can remove them from the system Node as follows:

     $ nvm use system
     $ npm uninstall -g a_module

=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="/opt/circleci/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

Exited with code exit status 1
CircleCI received exit code 1

Expected behavior:

Install Node v12

Additional Information:

@gmemstr
Copy link
Contributor

gmemstr commented Oct 23, 2020

I'm inclined to believe this isn't related to the orb, but instead nvm. Can you confirm whether you can replicate this locally, or in a Docker container?

@marcghorayeb
Copy link

Seeing this as well - seems like nvm is already installed on the machine executor image in CircleCI and fails at updating it.

@kc-currenxie
Copy link

kc-currenxie commented Oct 27, 2020

This works for me

  abc:
    machine:
      docker_layer_caching: true
    steps:
      - run: |
          source /opt/circleci/.nvm/nvm.sh
          nvm install v12
          nvm alias default v12
          echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
          echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV
      - node/install-yarn
      - node/install-packages:
          pkg-manager: yarn
          include-branch-in-cache-key: false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants