Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm --registry=http://registry.cnpmjs.org 有坑 #103

Closed
alsotang opened this issue Dec 18, 2013 · 3 comments
Closed

npm --registry=http://registry.cnpmjs.org 有坑 #103

alsotang opened this issue Dec 18, 2013 · 3 comments
Assignees
Milestone

Comments

@alsotang
Copy link
Member

@alsotang alsotang commented Dec 18, 2013

当我使用这句话装包的时候(npm --registry=http://registry.cnpmjs.org i express),返回 401。
相关代码在
qq20131218-2

由于我是 npm login 过的,所以我的请求自带 http basic auth 的头,于是在这一步被强迫验证从而被返回 401。


当使用 cnpm 的时候就可以成功安装包。因为 cnpm 默认使用空白的 .cnpmrc 文件,覆盖了 npm 原生的 auth 信息。
qq20131218-4

@alsotang
Copy link
Member Author

@alsotang alsotang commented Dec 18, 2013

这句话 alias cnpm="npm --registry=http://registry.cnpmjs.org --cache=$HOME/.npm/.cache/cnpm"

我觉得应该从以下配置琢磨琢磨到底带哪些参数。

var config = module.exports = {
  cnpmHost: 'http://cnpmjs.org',
  cnpmRegistry: 'http://registry.cnpmjs.org',
  disturl: 'http://dist.u.qiniudn.com', // download dist tarball for node-gyp
  cache: path.join(root, '.npm/.cache/cnpm'),  //cache folder name
  userconfig: path.join(root, '.cnpmrc')
};
@dead-horse
Copy link
Member

@dead-horse dead-horse commented Dec 18, 2013

�还要加userconfig

@fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Dec 18, 2013

可以将文档修改一下

@ghost ghost assigned dead-horse Dec 18, 2013
fengmk2 added a commit that referenced this issue Dec 19, 2013
fix doc, fixed #103
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants