简体   繁体   中英

How to install a NodeJS package from a github repo

I'm trying to install a package from a github repo but I get the following message:

npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/z0019rb/.nvm/versions/node/v4.4.7/bin/node" "/Users/z0019rb/.nvm/versions/node/v4.4.7/bin/npm" "install"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/target-digital-design-tokens
npm ERR! 404
npm ERR! 404 'target-digital-design-tokens' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'target-base-pattern-library'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/z0019rb/dev/design-systems/designsystems-site/npm-debug.log

And this is what my package.json looks like:

"target-digital-design-tokens": "git+ssh://git@git.target.com:design-systems/design-tokens.git"

Not sure what I'm doing wrong. The repo which I'm trying to install has a package.json. Thanks!

try this instead :

"git+https://target.com/design-systems/design-tokens"

and don't forget to set git repo in your package.json like so :

"repository": {
    "type": "git",
     "url": "git@target.com:design-systems/design-tokens.git"
 },

If the git server is behind a proxy don't forget to set env http_proxy before npm install something like this :

npm config set proxy "http://domain......@myproxy:8080"
npm config set https-proxy "http://domain......@myproxy:8080"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM