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

166
Vistas
Why did I lose my javascript file to npm?

I wrote up a small library, just a .js file with some frequently used functions, and dropped it into the node_modules folder so it was alongside all of my other packages. Great.

A few days later, I added a new package with npm install. When I ran the program to test it, I got errors for my library missing, and sure enough it was no longer in the node_modules folder, recycling bin, or even appearing in my source control because I gitignore'd the folder.

As someone who's new to projects that use more than a handful of files, could someone please explain what may have caused this, and how I can prevent it in the future?

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

0

node_modules isn’t for your own files; it’s managed entirely by npm based on the contents of your package.json. You should put those in the directory that contains node_modules, and load them with relative imports (import foo from './foo' or require('./foo')).

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