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

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

Projects

None yet

3 participants

@alsotang
Member

当我使用这句话装包的时候(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
Member

这句话 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
Member

�还要加userconfig

@fengmk2
Member
fengmk2 commented Dec 18, 2013

可以将文档修改一下

@dead-horse dead-horse was assigned Dec 18, 2013
@dead-horse dead-horse added a commit that closed this issue Dec 19, 2013
@dead-horse dead-horse fix doc, fixed #103 bda6fa7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment