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

Comments

Projects
None yet
3 participants
@alsotang
Member

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

This comment has been minimized.

Member

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

This comment has been minimized.

Member

dead-horse commented Dec 18, 2013

�还要加userconfig

@fengmk2

This comment has been minimized.

Member

fengmk2 commented Dec 18, 2013

可以将文档修改一下

@ghost ghost assigned dead-horse Dec 18, 2013

fengmk2 added a commit that referenced this issue Dec 19, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment