I have a project that depends on several third-party libs.
My package.json looks like:
"dependencies": { "vendor-name": "git://github.com/vendor/name.git#v1.1", ... }
This works as long as the vendor-name
repository contains a package.json
.
If there's not such a file, I get:
npm ERR! path /var/folders/0l/temp-folder/package.json npm ERR! code ENOENT
Actually, a npm install git://github.com/vendor/name.git#v1.1
does not work, too.
So my question is: Is there a way to install (include) git repositories (in the dependencies
) that do not have a package.json
?
All npm packages contain a file, usually in the project root, called package. json - this file holds various metadata relevant to the project. This file is used to give information to npm that allows it to identify the project as well as handle the project's dependencies.
npm install git doesn't install git (i.e. the command line tool to manipulate git repositories). It installs the npm package called git which seems to be a JavaScript library to interact with git repositories (which makes the name accurate, but still misleading). npm is not a general-purpose package manager.
To recap, you should always include both package. json and package-lock. json in your source control. Thus, never put them in the .
Yes you can with this package: https://npmjs.org/package/napa
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With