Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

162
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!