Giter Site home page Giter Site logo

Comments (9)

JalexChen avatar JalexChen commented on July 19, 2024

Hi @korya - I'm noticing you are using the lts tag. we just built and pushed up new images with the fixes from yesterday. Could you please check if you are still being affected?

from cimg-node.

korya avatar korya commented on July 19, 2024

Yes, same issue: https://app.circleci.com/pipelines/github/korya/circleci-node-issue/1/workflows/f7721791-349e-4ef2-a14a-65fcf40444ec/jobs/1

from cimg-node.

JalexChen avatar JalexChen commented on July 19, 2024

Hi @korya, from what i've discovered, the good image that you're referencing is an image that i built and was creating a symlink from where nvm was to where node and npm would normally be. since then, that functionality has been changed and the symlink is no longer created, which is causing node to not be found where it normally is; specifically this command in the Dockerfile:

sudo ln -s "$NVM_DIR/versions/node/$(nvm version)/bin/node" "/usr/local/bin/node" && sudo ln -s "$NVM_DIR/versions/node/$(nvm version)/bin/npm" "/usr/local/bin/npm"

there are two solutions here (that i know of):

  1. "$NVM_DIR/versions/node/v16.15.0/bin/npm --prefix packages/sub-project test" would allow you to run things correctly, in the package.json test pair, however, this requires you to hard code the node version v16.15.0, which is fine if you are not switching between any versions of node

  2. cd packages/sub-project && chmod +x test.sh && npm run test would also run the tests successfully regardless of image and could be implemented as a run step

from cimg-node.

korya avatar korya commented on July 19, 2024

@JalexChen thanks for the update.

The second solution suggested by you is what we used to do in the past before we migrated to workspaces. We will use it until the issue is solved properly.

Do you have any idea what is the priority of this bug and when it is going to be fixed?

from cimg-node.

markwhitfeld avatar markwhitfeld commented on July 19, 2024

We are also having problems with this image.
I left a comment on the PR: #237 (comment)
Wouldn't rolling back the nvm changes be the step to take in the interim?

from cimg-node.

JalexChen avatar JalexChen commented on July 19, 2024

Hey @korya - a couple of things here:

  • --prefix is 1) not compatible with nvm (per the errors) 2) is not aware of workspaces
  • instead, using "npm test --workspaces" for your test key in package.json would execute correctly and you could add as many different workspaces within that key; looks like you and your team has migrated to workspaces, so this seems appropriate
  • lastly, you could also replace --prefix and run cd packages/sub-project && npm test

let me know if this works for you

from cimg-node.

korya avatar korya commented on July 19, 2024

Thanks for you response.

--workspaces will not work for us because we need to run a script in a specific package at a specific time. Will npm run -w <DIR> <SCRIPT> work with nvm?

The last options works but is less ideal because it requires us to significantly change our build scripts. We would like to avoid doing it because of a regression bug in a CI image.

from cimg-node.

JalexChen avatar JalexChen commented on July 19, 2024

Hi @korya,

yes, npm run -w package/sub-project test would work per the workspaces docs and there are no conflicts with nvm :)

from cimg-node.

korya avatar korya commented on July 19, 2024

@JalexChen Thanks! The suggested approach works as expected.

from cimg-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.