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

Download package failed after sinopia config registry #19

Closed
boudoury opened this issue Dec 6, 2013 · 14 comments
Closed

Download package failed after sinopia config registry #19

boudoury opened this issue Dec 6, 2013 · 14 comments

Comments

@boudoury
Copy link

boudoury commented Dec 6, 2013

I start with install sinopia version 0.4.3 and it finish well.Then, I configured the registry as: npm set registry http://localhost:4873/
So after that I tried to download some package and it didn't work and i have got that;

C:\Users\tuto>npm install grunt
npm http GET http://localhost:4873/grunt
npm http 407 http://localhost:4873/grunt
npm ERR! TypeError: Cannot call method 'match' of undefined
npm ERR! at RegClient. (C:\Program Files\nodejs\node_modules\npm
node_modules\npm-registry-client\lib\request.js:119:29)
npm ERR! at cb (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-re
gistry-client\lib\request.js:158:9)
npm ERR! at RegClient. (C:\Program Files\nodejs\node_modules\npm
node_modules\npm-registry-client\lib\request.js:252:14)
npm ERR! at Request.self.callback (C:\Program Files\nodejs\node_modules\npm
node_modules\request\request.js:129:22)
npm ERR! at Request.EventEmitter.emit (events.js:98:17)
npm ERR! at Request. (C:\Program Files\nodejs\node_modules\npm\no
de_modules\request\request.js:873:14)
npm ERR! at Request.EventEmitter.emit (events.js:117:20)
npm ERR! at IncomingMessage. (C:\Program Files\nodejs\node_module
s\npm\node_modules\request\request.js:824:12)
npm ERR! at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR! at streamreadable.js:920:16
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod
ejs\node_modules\npm\bin\npm-cli.js" "install" "grunt"
npm ERR! cwd C:\Users\tuto
npm ERR! node -v v0.10.19
npm ERR! npm -v 1.3.11
npm ERR! type non_object_property_call
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\tutp\npm-debug.log
npm ERR! not ok code 0

So what Iam supposed to do???

@rlidwka
Copy link
Owner

rlidwka commented Dec 6, 2013

Can you please restore ~/.npmrc to a default configuration and try again?

I believe something like this could happen if you have an npmjs session ([_token] section in ~/.npmrc). I'm not sure though since 407 error code is weird, and we use 403 instead, so I'm a bit confused about where it is coming from.

@boudoury
Copy link
Author

boudoury commented Dec 7, 2013

I restore my npmrc and when I try to download a module which I have already it pass okay but when I try to download a module which Idon't have it will fail when this error:

C:\Users\Tuto>npm install karma-qunit
npm http GET http://localhost:4873/karma-qunit
npm http GET http://localhost:4873/karma-qunit
npm http GET http://localhost:4873/karma-qunit
npm ERR! Error: connect ECONNREFUSED
npm ERR! at errnoException (net.js:901:11)
npm ERR! at Object.afterConnect as oncomplete
npm ERR! { [Error: connect ECONNREFUSED]
npm ERR! code: 'ECONNREFUSED',
npm ERR! errno: 'ECONNREFUSED',
npm ERR! syscall: 'connect' }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly. See: 'npm help config'

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program File
s (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" "karma-qunit"
npm ERR! cwd C:\Users\Tuto
npm ERR! node -v v0.10.13
npm ERR! npm -v 1.3.2
npm ERR! syscall connect
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! stack Error: connect ECONNREFUSED
npm ERR! stack at errnoException (net.js:901:11)
npm ERR! stack at Object.afterConnect as oncomplete
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\Tuto\npm-debug.log
npm ERR! not ok code 0

@rlidwka
Copy link
Owner

rlidwka commented Dec 7, 2013

'ECONNREFUSED' means that there is nothing listening on that port, i.e. sinopia is not running.

@boudoury
Copy link
Author

boudoury commented Dec 7, 2013

How can i check if sinopia is running or not?

@rlidwka
Copy link
Owner

rlidwka commented Dec 7, 2013

Hmm... launch it in the terminal and look at the logs?

I'm sorry, but I have no idea how are you running it. And frankly speaking I have no idea what Windows is, so I might not understand something.

You might find a better luck asking it in node.js mailing list, because sinopia is an ordinary http server, running it is no different than running node.js itself, and there are a lot of people there who can explain it better than me.

Cannot call method 'match' of undefined looks like a bug. However, ECONNREFUSED is definitely not.

@iambrandonn
Copy link
Contributor

You should be able to open the task manager and see if a Node process is running. If not that is your first step... start the sinopia process. If it is running you should make sure it is running on port 4873. If it still doesn't work it could be a firewall issue.

@boudoury
Copy link
Author

boudoury commented Dec 9, 2013

that's okay Node process is running and the sinopia started, so when i try to download some package it's always failed and i got this message:

C:\Users\tuto>npm install karma
npm http GET http://localhost:4873/karma
npm http 404 http://localhost:4873/karma
npm ERR! Error: no such package available : karma
npm ERR! at RegClient. (C:\Program Files\nodejs\node_modules\npm
node_modules\npm-registry-client\lib\request.js:272:14)
npm ERR! at Request.self.callback (C:\Program Files\nodejs\node_modules\npm
node_modules\request\request.js:129:22)
npm ERR! at Request.EventEmitter.emit (events.js:98:17)
npm ERR! at Request. (C:\Program Files\nodejs\node_modules\npm\no
de_modules\request\request.js:873:14)
npm ERR! at Request.EventEmitter.emit (events.js:117:20)
npm ERR! at IncomingMessage. (C:\Program Files\nodejs\node_module
s\npm\node_modules\request\request.js:824:12)
npm ERR! at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR! at _stream_readable.js:920:16
npm ERR! at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod
ejs\node_modules\npm\bin\npm-cli.js" "install" "karma"
npm ERR! cwd C:\Users\tuto
npm ERR! node -v v0.10.19
npm ERR! npm -v 1.3.11
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\tuto\npm-debug.log
npm ERR! not ok code 0

@rlidwka
Copy link
Owner

rlidwka commented Dec 9, 2013

It would be helpful to see sinopia's own config and logs.

@boudoury
Copy link
Author

I tried to install for exemple Karma and this what I got, this my .npmrc file config :

registry = http://localhost:4873/

and my npm-debug.log file log:


0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\\node.exe',
1 verbose cli   'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'karma' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink C:\Program Files\nodejs\node.exe
5 verbose cache add [ 'karma', null ]
6 verbose cache add name=undefined spec="karma" args=["karma",null]
7 verbose parsed url { protocol: null,
7 verbose parsed url   slashes: null,
7 verbose parsed url   auth: null,
7 verbose parsed url   host: null,
7 verbose parsed url   port: null,
7 verbose parsed url   hostname: null,
7 verbose parsed url   hash: null,
7 verbose parsed url   search: null,
7 verbose parsed url   query: null,
7 verbose parsed url   pathname: 'karma',
7 verbose parsed url   path: 'karma',
7 verbose parsed url   href: 'karma' }
8 silly lockFile 512423cb-karma karma
9 verbose lock karma C:\Users\tuto\AppData\Roaming\npm-cache\512423cb-karma.lock
10 silly lockFile 512423cb-karma karma
11 silly lockFile 512423cb-karma karma
12 verbose addNamed [ 'karma', '' ]
13 verbose addNamed [ null, '_' ]
14 silly lockFile cd7961bb-karma karma@
15 verbose lock karma@ C:\Users\tuto\AppData\Roaming\npm-cache\cd7961bb-karma.lock
16 silly addNameRange { name: 'karma', range: '_', hasData: false }
17 verbose url raw karma
18 verbose url resolving [ 'http://localhost:4873/', './karma' ]
19 verbose url resolved http://localhost:4873/karma
20 info trying registry request attempt 1 at 09:13:50
21 http GET http://localhost:4873/karma
22 http 404 http://localhost:4873/karma
23 silly registry.get cb [ 404,
23 silly registry.get   { 'x-powered-by': 'Express',
23 silly registry.get     'content-type': 'application/json',
23 silly registry.get     etag: '"e1aa0ae8f9569429f8461e77a51a5d6d"',
23 silly registry.get     'content-length': '41',
23 silly registry.get     vary: 'Accept-Encoding',
23 silly registry.get     date: 'Tue, 10 Dec 2013 08:14:11 GMT',
23 silly registry.get     connection: 'keep-alive' } ]
24 silly lockFile cd7961bb-karma karma@
25 silly lockFile cd7961bb-karma karma@
26 error Error: no such package available : karma
26 error     at RegClient. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\request.js:272:14)
26 error     at Request.self.callback (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:129:22)
26 error     at Request.EventEmitter.emit (events.js:98:17)
26 error     at Request. (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:873:14)
26 error     at Request.EventEmitter.emit (events.js:117:20)
26 error     at IncomingMessage. (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:824:12)
26 error     at IncomingMessage.EventEmitter.emit (events.js:117:20)
26 error     at _stream_readable.js:920:16
26 error     at process._tickCallback (node.js:415:13)
27 error If you need help, you may report this log at:
27 error     http://github.com/isaacs/npm/issues
27 error or email it to:
27 error     [email protected]
28 error System Windows_NT 6.1.7601
29 error command "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "karma"
30 error cwd C:\Users\tuto
31 error node -v v0.10.22
32 error npm -v 1.3.14
33 verbose exit [ 1, true ]

@boudoury
Copy link
Author

and this config.yaml:


# path to a directory with all packages
storage: ./storage
# a list of users
users:
  admin:
    # crypto.createHash('sha1').update(pass).digest('hex')
    password: *(censored - rlid)*
# a list of other known repositories we can talk to
uplinks:
  npmjs:
    url: https://registry.npmjs.org/
packages:
  # uncomment this for packages with "local-" prefix to be available 
  # for admin only, it's a recommended way of handling private packages
  #'local-*':
  #  allow_access: admin
  #  allow_publish: admin
  '*':
    # allow all users to read packages ('all' is a keyword)
    # this includes non-authenticated users
    allow_access: all
    # allow 'admin' to publish packages
    allow_publish: admin
    # if package is not available locally, proxy requests to 'npmjs' registry
    proxy_access: npmjs
    # when package is published locally, also push it to remote registry
    #proxy_publish: none
#####################################################################
# Advanced settings
#####################################################################
# if you use nginx with custom path, use this to override links
#url_prefix: https://dev.company.local/sinopia/
# you can specify listen address (or simply a port)
#listen: localhost:4873
# type: file | stdout | stderr
# level: trace | debug | info | http (default) | warn | error | fatal
#
# parameters for file: name is filename
#  {type: 'file', path: 'sinopia.log', level: 'debug'},
#
# parameters for stdout and stderr: format: json | pretty
#  {type: 'stdout', format: 'pretty', level: 'debug'},
logs:
  - {type: stdout, format: pretty, level: http}
  #- {type: file, path: sinopia.log, level: info}

@rlidwka
Copy link
Owner

rlidwka commented Dec 10, 2013

Sinopia logs, not npm ones... If you uncomment a very last line in your config file (and preferably set level to "trace"), you'll see file "sinopia.log" containing all information about what is it doing.

@boudoury
Copy link
Author

Okay, so I do it and this is sinopia log file, my guess is a timeout connexion problem isn't it?


{"name":"sinopia","hostname":"EMEA-TUN-WS0180","pid":4000,"level":40,"addr":"http://localhost:4873/","msg":"Server is listening on @{addr}","time":"2013-12-10T10:19:09.589Z","v":0}
{"name":"sinopia","hostname":"EMEA-TUN-WS0180","pid":4000,"sub":"in","level":30,"req":{"method":"GET","url":"/grunt","headers":{"accept":"application/json","user-agent":"node/v0.10.22 win32 ia32","host":"localhost:4873","connection":"keep-alive"},"remoteAddress":"127.0.0.1","remotePort":52926},"ip":"127.0.0.1","msg":"@{ip} requested '@{req.method} @{req.url}'","time":"2013-12-10T10:19:19.229Z","v":0}
{"name":"sinopia","hostname":"EMEA-TUN-WS0180","pid":4000,"sub":"out","level":30,"method":"GET","headers":{"accept":"application/json","user-agent":"Sinopia/0.5.0"},"uri":"https://registry.npmjs.org/grunt","msg":"making request: '@{method} @{uri}'","time":"2013-12-10T10:19:19.234Z","v":0}
{"name":"sinopia","hostname":"EMEA-TUN-WS0180","pid":4000,"sub":"out","level":35,"err":{"message":"connect ETIMEDOUT","name":"Error","stack":"Error: connect ETIMEDOUT\n    at errnoException (net.js:901:11)\n    at Object.afterConnect [as oncomplete] (net.js:892:19)","code":"ETIMEDOUT"},"request":{"method":"GET","url":"https://registry.npmjs.org/grunt"},"status":"ERR","error":"connect ETIMEDOUT","bytes":{"in":0,"out":0},"msg":"@{!status}, req: '@{request.method} @{request.url}', error: @{!error}","time":"2013-12-10T10:19:40.263Z","v":0}
{"name":"sinopia","hostname":"EMEA-TUN-WS0180","pid":4000,"sub":"in","level":35,"request":{"method":"GET","url":"/grunt"},"status":404,"error":"no such package available","bytes":{"in":0,"out":41},"msg":"@{status}, user: @{user}, req: '@{request.method} @{request.url}', error: @{!error}","time":"2013-12-10T10:19:40.265Z","v":0}

@rlidwka
Copy link
Owner

rlidwka commented Dec 10, 2013

Error: connect ETIMEDOUT

Yeah, it is. No idea what's causing it.

You can try to replace https://registry.npmjs.org/ with http://registry.npmjs.eu/. This way you can rule out npmjs issues.

@rlidwka
Copy link
Owner

rlidwka commented Jun 7, 2015

I believe you're behind a proxy, and it's the proxy configuration at fault here. See #254 for details.

I disabled X-Forwarded-For if "proxy" is explicitly specified in config/env in 0d266be, hope that helps. If you're behind a transparent proxy which reacts strangely to that header, you'd better contact your ISP.

@rlidwka rlidwka closed this as completed Jun 7, 2015
dididada123 pushed a commit to dididada123/sinopia that referenced this issue Aug 8, 2016
update install instructions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants