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!