Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

165
Visualizações
typescript version mismatch

My project has a structure like this:

workspace
  |__pkg1
      |__tsconfig.json
      |__package.json
      |__ts/
  |__pkg2
      |__tsconfig.json
      |__package.json
      |__ts/
  |__lerna.json
  |__package.json
  |__tsconfig.json

In workspace/package.json, I specified the typescript version to be "^4.2.3". To install the dependency for all packages, run the command under workspace directory:

npm install & lerna bootstrap && lerna run build

"lerna bootstrap" will install all the dependencies for pkg1 and pkg2, "lerna run build" (equivalent to run "npx tsc" in pkg1 and pkg2) will compile typescript in ts/ folder from pkg1 and pkg2. It turned out the tsc version in workspace directory is indeed 4.2.3, but in pkg1 and pkg2, the typescript version is 4.5.2

cd pkg1 && npx tsc -v # output is Version 4.5.2

I have tried (1) to change "^4.2.3" to "4.2.3" in workspace/package.json, (2) specify typescript version explicitly in package.json from pkg1 and pkg2. (3) remove all package-lock.json files. However, neither of them work. How can I fix it?

In practice, I need build a clean docker image for this project. It have multiple pkgs, so I don't want to install typescript one by one in each of the package directory.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

try removing all the code which is related to typescript from the package-lock.json and npm install again and check. I think this should solve the issue as I have too experienced this before.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda