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

88
Views
Importación de archivos mecanografiados con errores en la ruta relativa

Al intentar ejecutar src/index.js , aparece el siguiente error:

 Error: Cannot find module './utils/spinner'

La importación de index.js se ve así:

 const { startSpinner, stopSpinner } = require('./utils/spinner')

Estructura de carpetas:

fold_struc

tsconfig.json se ve así:

 { "extends": "@tsconfig/node12/tsconfig.json", "compilerOptions": { "outDir": "lib", "rootDir": "src", "sourceMap": true, "allowJs": true }, "include": [ "src/**/*" ], "exclude": [ "src/**/__tests__/*", "src/**/*.test.ts" ] }

@tsconfig/node12/tsconfig.json se ve así:

 { "$schema": "https://json.schemastore.org/tsconfig", "display": "Node 12", "compilerOptions": { "lib": ["es2019", "es2020.promise", "es2020.bigint", "es2020.string"], "module": "commonjs", "target": "es2019", "strict": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true } }

Intenté agregar baseUrl a tsconfig.json y configurarlo en .src , src , /src e intenté hacer lo mismo con cada variación de rootDir .

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede resolver esto cambiando el nombre de index.js a index.ts y ejecutando todo con ts-node : https://npmjs.com/package/ts-node .

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!