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

196
Visualizações
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 Respostas
Responde à pergunta

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 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