Comments (9)
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.
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.
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):
-
"$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 -
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.
@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.
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.
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.
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.
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.
@JalexChen Thanks! The suggested approach works as expected.
from cimg-node.
Related Issues (20)
- Recent versions of image cause jest to fail HOT 1
- permissions on node 16:17 HOT 1
- Using the image in other CI tools HOT 3
- shallow checkout HOT 5
- /home/circleci/.local/bin is in path but doesnโt exist by default HOT 2
- Can you create this image please? HOT 1
- Publish major version (only) tag pointing at the latest build for a major node version HOT 1
- Base Ubuntu version changing HOT 2
- cimg/node:16.18 & cimg/node:16.19: "Mongod instance closed with code \"127\"" was thrown, throw an Error :) HOT 2
- Migrating from circleci/node:16.13-browsers to cimg/node:16-13 HOT 2
- Feature Request: Update open JDK to the next LTS HOT 4
- Feature Request: Include Bun (bun install) HOT 1
- Bug Report: Missing Node.js 20.6.1 release
- Feature Request: cimg/node browsers arm64 support HOT 2
- Bug Report: wrong LTS version HOT 3
- Feature Request: Update open JDK in -browsers image to the next LTS (17)
- Bug Report: automated-wf is broken
- Feature Request: variant with browsers and test drivers preinstalled
- Feature Request: February Node security releases HOT 4
- Feature Request: Enable corepack by default HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cimg-node.