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

277
Vistas
How to test an npm package that you created locally?

I created a test package that I want to publish locally.

I have two folders the first one is the test package and the second is a test project where I want to install the package.


└── cousel-package
│   ├── index.js
│   └── package.json
└── test-project
    └── script.js

index.js:

function console_package_text(){
    console.log('i am a package!')
}

module.exports = console_package_text

script.js:

require('cousel-package')

In the test package I ran npm init -y and the package.json got created.

package.json:

{
  "name": "cousel-package",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}

and I ran npm link.

then in the test project i run npm link cousel-package. and got:

added 1 package, removed 1 package, changed 1 package, and audited 5 packages in 2s

found 0 vulnerabilities

the problem is that the node module file doesn't get created! while I get the message that the package is added!

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