Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

274
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!