sij
sij

Reputation: 1347

npm install outside command prompt

I am over a proxy, and npm install seems blocked, I tried many things, the last i did was following these steps, which also failed,leave it.

Lately I found the reason which is git protocol is blocked by firewall

But when i tried the same link (registry/module) over browser it gave me the json.

So my doubt is do we have any other way to install modules other than shooting an npm install command.

I can see the json over the browser, hope i can copy it, put in a file, in some folder and node just assumes it to be installed.

Upvotes: 0

Views: 392

Answers (2)

user568109
user568109

Reputation: 48003

Node Package Manager is flexible in what it treats as package. Given command npm install <package>

A package is:

a) a folder containing a program described by a package.json file
b) a gzipped tarball containing (a)
c) a url that resolves to (b)
d) a <name>@<version> that is published on the registry with (c)
e) a <name>@<tag> that points to (d)
f) a <name> that has a "latest" tag satisfying (e)
g) a <git remote url> that resolves to (b)

See this documentation on npm install for more help.

Upvotes: 0

Thomas Ingham
Thomas Ingham

Reputation: 1102

NPM installs resolve to the files themselves. In most cases you can git sub mod checkout directly into your node_modules directory inside of your project installation and things should just work.

If you can't checkout from git either, simply download the tarball (or zip) archive from the git project page and drop the resulting directory into node_modules.

You might need to rename the resulting directory contained in the Zip archive with the string from the package.json file at the top level of the directory. This will resolve in your require statements.

Upvotes: 3

Related Questions