Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

197
Vistas
Files are not packed when importing package.json

I'm writing a cli package and for showing the version I'm importing version from package.json.

When I do that, after running tsc the dist folder looks like that:

/dist
--/package.json
--/README.md
--/src
----files
----...

the package.json has the following property:

  "files": [
    "dist/**/*"
  ],

I use npm pack to see what will be part of the tarball. when I try to pack it, only 3 files are packed:

npm notice 1.9kB dist/package.json
npm notice 1.7kB package.json     
npm notice 1.2kB README.md    

but If I don't import the version from package.json, it is no longer in the dist directory and all the content in dist gets packed properly.

As a temporary measure I'm reading package.json with fs, but that's far an elegant solution. Is there a way to solve this issue?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The issue caused by npm, downgrading permission (ran as root on the ci), adding to the npm config unsafe-perm solved it.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda