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

Cannot run node/install-packages running using a Ramdisk #119

Closed
tomsquest opened this issue Jan 20, 2022 · 1 comment · Fixed by #137
Closed

Cannot run node/install-packages running using a Ramdisk #119

tomsquest opened this issue Jan 20, 2022 · 1 comment · Fixed by #137
Labels
bug Something isn't working

Comments

@tomsquest
Copy link

tomsquest commented Jan 20, 2022

Orb version: circleci/node@5

What happened:

Cannot run node/install-packages running using a Ramdisk (CircleCI doc).

Extract from config.yml:

    working_directory: /mnt/ramdisk
    steps:
      - checkout
      - node/install-packages

Error:

ln: failed to create hard link '/tmp/node-project-lockfile' => 'package-lock.json': Invalid cross-device link

Expected behavior:

Running in a Ramdisk should still allow to install packages.

Additional Information:

Full error:

#!/bin/bash -eo pipefail
if [ -f "package-lock.json" ]; then
  echo "Found package-lock.json file, assuming lockfile"
  ln package-lock.json /tmp/node-project-lockfile
elif [ -f "npm-shrinkwrap.json" ]; then
  echo "Found npm-shrinkwrap.json file, assuming lockfile"
  ln npm-shrinkwrap.json /tmp/node-project-lockfile
elif [ -f "yarn.lock" ]; then
  echo "Found yarn.lock file, assuming lockfile"
  ln yarn.lock /tmp/node-project-lockfile
fi
ln package.json /tmp/node-project-package.json

Found package-lock.json file, assuming lockfile
ln: failed to create hard link '/tmp/node-project-lockfile' => 'package-lock.json': Invalid cross-device link

Exited with code exit status 1

CircleCI received exit code 1

config.yml:

version: 2.1

orbs:
  node: circleci/node@5

jobs:
  build:
    docker:
      - image: cimg/node:14.18.1
    working_directory: /mnt/ramdisk
    steps:
      - checkout
      - node/install-packages:
          include-branch-in-cache-key: false

Edit: upgraded to circleci/node@5

@tomsquest tomsquest added the bug Something isn't working label Jan 20, 2022
@tomsquest tomsquest changed the title cannot run node/install-packages running using a Ramdisk Cannot run node/install-packages running using a Ramdisk Jan 20, 2022
@Jaryt
Copy link
Contributor

Jaryt commented Feb 9, 2022

Hi! Thanks for reporting. I believe using symbolic links rather than hardlinking the file may solve this issue.

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.

2 participants