node.js – npm install from tgz created with npm pack

node.js – npm install from tgz created with npm pack

This error means you are not in a directory that has a package.json file and you are using the command that installs a package as a dependency into an existing, (local) npm projects package.json.

To install your package globally (just to test if it can be installed):

npm install -g package-0.0.1.tgz

Or, if you want to install/add it as a dependency to some other npm project (like a test harness), first make sure that npm project has a package.json, and then :

test-harness-dir> npm install package-0.0.1.tgz

node.js – npm install from tgz created with npm pack

Leave a Reply

Your email address will not be published.