-
Notifications
You must be signed in to change notification settings - Fork 19
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
NEX-175: Add the possibility of running npx commands in lando #258
Conversation
@@ -154,6 +158,8 @@ services: | |||
# We instruct node to use the Lando CA certificate for HTTPS connections: | |||
NODE_EXTRA_CA_CERTS: /lando/certs/LandoCA.crt | |||
build: | |||
# This is needed to be able to run lando npx commands: | |||
- "mkdir -p /var/www/.npm-global/lib" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the node
user inside the docker container /var/www is the home folder, the directory needs to be there for npx to work, apparently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tooling:
npx:
service: node
doesn't work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work both ways.
Lets add
dir: /app/next
there too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for the explanation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest installing npm
globally instead. This would be a cleaner solution:
services:
node:
type: node:20
globals:
npm: latest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! I tested it and it works, let's switch to that.
Committed in faefbac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, makes Shadcn'izing much easier :)
This branch adds the npx command to lando.
To test:
git clean -d -f
./setup-lando.sh -c
lando npx shadcn@latest add badge