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

253
Vistas
how to use npm package with hugo

I have a simple hugo site made with this command

hugo new site quickstart

and inside layouts/_default/baseof.html i have included a JavaScript file, named script.js and inside script.js i have this code:

import $ from 'jquery'

but when i check my browser console, it shows me this error:

Uncaught TypeError: Error resolving module specifier “jquery”. Relative module specifiers must start with “./”, “../” or “/”.

in my root folder, where i have all the folders like "content", "data", "public", "archetypes" i have installed jquery using npm but i still get this error.

Note: I don't want to include jquery from a cdn, or download the file.

Edit:

I tried using relative path to jquery inside node_modules folder using this code:

import $ from '../../../node_modules/jquery/dist/jquery.min'

but then get this error:

GET http://localhost:1313/node_modules/jquery/dist/jquery.min
about 4 years ago · Juan Pablo Isaza
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