Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install npm local module directory without symlinks?

So here is the simple file layout.

/my-module
..package.json
/my-app
..package.json

I want my-app to install my-module locally. I tried this:

"dependencies": {
    "myModule": "../my-module"
}

The option -no-bin-links does not work, it only effects node_modules/bin It creates a symlink and does not install the node_modules. I would like to do one of two things, not use the symlink and install node_modules, or use the symlink and install the modules. Ideally combined with peerDependencies when using no symlinks.

like image 219
jemiloii Avatar asked Apr 24 '18 20:04

jemiloii


1 Answers

npm current cannot install directly from a folder without a symlink.

You can get around this by generating a tarball from the folder with npm pack, run from the directory of the package you want to install, followed by npm install <tarball>, where <tarball> is the path to your tarball of the package.

like image 116
JustinLovinger Avatar answered Oct 11 '22 10:10

JustinLovinger