habmic / opentelemetry-101

69 stars 43 forks source link

missing ts-node-dev #4

Open jbhardman opened 1 year ago

jbhardman commented 1 year ago

When running docker-compose up, the containers for todo and auth fail to start because of the missing command ts-node-dev.

opentelemetry-101-todo-1   | yarn run v1.22.15
opentelemetry-101-auth-1   | yarn run v1.22.15
opentelemetry-101-todo-1   | $ ts-node-dev todo-service.ts
opentelemetry-101-auth-1   | $ ts-node-dev auth-service.ts
opentelemetry-101-todo-1   | /bin/sh: 1: ts-node-dev: not found
opentelemetry-101-auth-1   | /bin/sh: 1: ts-node-dev: not found
opentelemetry-101-todo-1   | error Command failed with exit code 127.
opentelemetry-101-todo-1   | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
opentelemetry-101-auth-1   | error Command failed with exit code 127.
opentelemetry-101-auth-1   | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
opentelemetry-101-auth-1 exited with code 127
opentelemetry-101-todo-1 exited with code 127

I tried tags 1 and 12. Same issue.

habmic commented 1 year ago

Can you try running yarn install?

jbhardman commented 1 year ago

Run it where? Inside the docker container? This build is all happening inside docker containers, not my local host.

habmic commented 1 year ago

Run it in the host, this is because there is a volume mounted for the host to the container

arunsippygmail commented 1 year ago

Hi need help, want to implement optel for mongodb in python, any suggestions or link how to use the same. I am new to opentelemetry and purchased ur course from UDEMY. Trying to make sense of the concept but I have PoC to complete, any suggestion documentation will help for metrics implementation

arunsippygmail commented 1 year ago

Run it in the host, this is because there is a volume mounted for the host to the container

It works after installation on HOST 👍

abhijeetNmishra commented 11 months ago

@habmic Can you please explain in more detail what this issue means? ran into same problem

abhijeetNmishra commented 11 months ago

got it resolved by adding the following code to docker-compose.yml file `volumes:

sandeepV2 commented 10 months ago

Yes executing yarn install followed by docker-compose up solved the issue.

$ yarn install

opentelemetry-101 git:(f8988db) yarn install yarn install v1.22.19 [1/4] 🔍 Resolving packages... [2/4] 🚚 Fetching packages... [3/4] 🔗 Linking dependencies... warning "ts-node-dev > ts-node@10.9.1" has unmet peer dependency "@types/node@*". [4/4] 🔨 Building fresh packages... ✨ Done in 5.89s.

docker-compose up

... .... opentelemetry-101-auth-1 | $ ts-node-dev auth-service.ts opentelemetry-101-todo-1 | $ ts-node-dev todo-service.ts opentelemetry-101-auth-1 | [INFO] 15:43:34 ts-node-dev ver. 2.0.0 (using ts-node ver. 10.9.1, typescript ver. 5.1.6) opentelemetry-101-todo-1 | [INFO] 15:43:34 ts-node-dev ver. 2.0.0 (using ts-node ver. 10.9.1, typescript ver. 5.1.6) opentelemetry-101-auth-1 | service is up and running! opentelemetry-101-todo-1 | service is up and running!

john-forrest commented 4 months ago

Thanks for the advice. This really should be mentioned in the course video:) Having said that, the docker files in the course are using node 16, which is now somewhat old and unlikely to be the version on your machine. "yarn install" or whatever probably needs to be run from within a docker container on the same base image.