In my situation I can't use npm publish
to publish a package on internet, then npm install
and use it! Don't want to publish it on remote server like nexus either.
Is there any way to install it from pc cache with npm install
command?
Asked
Active
Viewed 56 times
0

Ishan Thilina Somasiri
- 1,179
- 1
- 12
- 24

Behzad Jafari
- 110
- 1
- 6
-
try this https://stackoverflow.com/questions/8088795/installing-a-local-module-using-npm – Ranjeet Avghad Jan 03 '18 at 05:17
-
i want to install it automatically not by giving path – Behzad Jafari Jan 03 '18 at 05:25
-
Copy it to your `node_modules` folder manually? – Ishan Thilina Somasiri Jan 03 '18 at 05:38
-
Put this in the `package.json`, as shown in this [SO answer](https://stackoverflow.com/questions/14381898/local-dependency-in-package-json). – neo Jan 03 '18 at 05:43
-
Possible duplicate of [Installing a local module using npm?](https://stackoverflow.com/questions/8088795/installing-a-local-module-using-npm) – Greg Rozmarynowycz Jan 03 '18 at 09:03
1 Answers
0
I usually created a folder called examples
an put into that a file called test.js
and I declared a variable like this var myModule = require("../index.js")
and then I declare the functions of my module like : myModule.substract()
. Also I did read about a module called NPX, I don't use It yet.