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

561
Visualizações
PdfMake | Error: ENOENT: no such file or directory, open './build/vfs_fonts.js'

I'm using the PDFMake library and trying to use a custom font in its output. This font is made for the Persian language. I followed the steps described on the web page below custom-fonts-client-side/vfs

I encountered the following error when executing the node build-vfs.js "./examples/fonts" command:

Internal/modules/cjs/loader.js:888
  throw err;
  ^

Error: Cannot find module 'D:\ProgrammingWorld\Github_Library\Cyeng\NewProject\onGit\NewProject\build-vfs.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
    at Function.Module._load (internal/modules/cjs/loader.js:730:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

So I decided to change the command and write it as follows:

node node_modules/pdfmake/build-vfs.js "node_modules\pdfmake\examples\fonts"

But unfortunately, I got a new error:

Source path: node_modules\pdfmake\examples\fonts

FILE: Shabnam-Bold.ttf
FILE: Shabnam-Light.ttf
FILE: Shabnam-Medium.ttf
FILE: Shabnam-Thin.ttf
FILE: Shabnam.ttf
internal/fs/utils.js:312
    throw err;
    ^

Error: ENOENT: no such file or directory, open './build/vfs_fonts.js'
    at Object.openSync (fs.js:498:3)
    at Object.writeFileSync (fs.js:1524:35)
    at Object.<anonymous> (D:\ProgrammingWorld\Github_Library\Cyeng\NewProject\onGit\NewProject\node_modules\pdfmake\build-vfs.js:41:4)
    at Module._compile (internal/modules/cjs/loader.js:1068:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:933:32)
    at Function.Module._load (internal/modules/cjs/loader.js:774:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: './build/vfs_fonts.js'
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Go to node_modules/pdfmake/ directory and run node build-vfs.js "./examples/fonts"

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