Squiggs.
Squiggs.

Reputation: 4474

Node Module Dependency 404 - npm can't find package.json

I have forked this https://github.com/SebastianM/angular-google-maps angular module into a private github repo, and I'm now trying to install and reference the fork.

I've ran the following:

npm install my-repo\angular-google-maps

and get the following error.

Could not install from "my-repo\angular-google-maps" as it does not contain a package.json file.

However this repo, definitely DOES contain a package json. I'm sitting here looking right at it as it taunts me.

Wondering if this is indeed the right command to run, and how to reference it in my angular project.

Upvotes: 1

Views: 541

Answers (1)

Estus Flask
Estus Flask

Reputation: 222474

npm install my-repo\angular-google-maps

is equivalent to

"angular-google-maps": "file:my-repo\\angular-google-maps"

dependencies entry. It installs the package from local my-repo\angular-google-maps directory, if it exists and contains package.json.

npm install my-repo/angular-google-maps

is equivalent to

"angular-google-maps": "my-repo/angular-google-maps"

dependencies entry. It installs the package from https://github.com/my-repo/angular-google-maps GitHub repository.

Considering that you're trying to install it from GitHub fork, the first choice is likely wrong.

Upvotes: 1

Related Questions