npmbox is outdated
Use npm pack
command (npm docs), no need to install anything.
Single package
If you want only one package (for example, forever
), you can run:
npm pack forever
this command will fetch it to the cache, and then copy the tarball to the current working directory as -.tgz
Then, from the folder you created the package, you install it with:
npm install -g ./forever-x.y.z.tgz
Whole project
If you want a whole project to be installed offline, include a poperty in your package.json
named bundleDependencies
and list all dependecies you need in this field.
// package.json
"dependencies": {
"archiver": "^2.1.1",
"axios": "^0.16.2",
"body-parser": "^1.18.3"
},
"bundleDependencies": {
"archiver": "^2.1.1",
"axios": "^0.16.2",
"body-parser": "^1.18.3"
}
Then run npm pack
.
It will create a .tgz
file of your whole project and dependencias.
You just have to copy it to the offline server and untar.