Cordova with Visual studio 2013 multiple hybrid ap

2019-09-06 07:11发布

This is my first post. please excuse me if any mistakes.

I have installed Visual Studio 2013 multi hybrid apps using cordova, and I am trying to build first javascript application that comes by default with the installation. I am getting the error "http 404 http://registry.npmjs.org/cordova"

Please advise

I am copying the entire response belw

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   '-g',
1 verbose cli   'cordova' ]
2 info using npm@1.4.28
3 info using node@v0.10.32
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 verbose cache add [ 'cordova', null ]
6 verbose cache add name=undefined spec="cordova" args=["cordova",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: 'cordova',
7 verbose parsed url   path: 'cordova',
7 verbose parsed url   href: 'cordova' }
8 silly lockFile a98f2055-cordova cordova
9 verbose lock cordova C:\Users\56647\AppData\Roaming\npm-cache\a98f2055-cordova.lock
10 silly lockFile a98f2055-cordova cordova
11 silly lockFile a98f2055-cordova cordova
12 verbose addNamed [ 'cordova', '' ]
13 verbose addNamed [ null, '*' ]
14 silly lockFile de8d9fad-cordova cordova@
15 verbose lock cordova@ C:\Users\n56647\AppData\Roaming\npm-cache\de8d9fad-cordova.lock
16 silly addNameRange { name: 'cordova', range: '*', hasData: false }
17 verbose request where is /cordova
18 verbose request registry http://registry.npmjs.org/
19 verbose request id eb7c76c14f367cc3
20 verbose url raw /cordova
21 verbose url resolving [ 'http://registry.npmjs.org/', './cordova' ]
22 verbose url resolved http://registry.npmjs.org/cordova
23 verbose request where is http://registry.npmjs.org/cordova
24 info trying registry request attempt 1 at 10:02:12
25 http GET http://registry.npmjs.org/cordova
26 http 404 http://registry.npmjs.org/cordova
27 verbose bad json <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
27 verbose bad json <html><head>
27 verbose bad json <title>404 Not Found</title>
27 verbose bad json </head><body>
27 verbose bad json <h1>Not Found</h1>
27 verbose bad json <p>The requested URL /cordova was not found on this server.</p>
27 verbose bad json </body></html>
28 error registry error parsing json
29 verbose headers { date: 'Sat, 11 Oct 2014 14:02:12 GMT',
29 verbose headers   server: 'Apache',
29 verbose headers   'content-length': '205',
29 verbose headers   connection: 'close',
29 verbose headers   'content-type': 'text/html; charset=iso-8859-1' }
30 silly registry.get cb [ 404,
30 silly registry.get   { date: 'Sat, 11 Oct 2014 14:02:12 GMT',
30 silly registry.get     server: 'Apache',
30 silly registry.get     'content-length': '205',
30 silly registry.get     connection: 'close',
30 silly registry.get     'content-type': 'text/html; charset=iso-8859-1' } ]
31 silly lockFile de8d9fad-cordova cordova@
32 silly lockFile de8d9fad-cordova cordova@
33 error SyntaxError: Unexpected token <
33 error <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
33 error <html><head>
33 error <title>404 Not Found</title>
33 error </head><body>
33 error <h1>Not Found</h1>
33 error <p>The requested URL /cordova was not found on this server.</p>
33 error </body></html>
33 error
33 error     at Object.parse (native)
33 error     at RegClient.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\request.js:274:23)
33 error     at Request._callback (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\request.js:246:65)
33 error     at Request.self.callback (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:236:22)
33 error     at Request.emit (events.js:98:17)
33 error     at Request.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:1142:14)
33 error     at Request.emit (events.js:117:20)
33 error     at IncomingMessage.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:1096:12)
33 error     at IncomingMessage.emit (events.js:117:20)
33 error     at _stream_readable.js:943:16
34 error If you need help, you may report this *entire* log,
34 error including the npm and node versions, at:
34 error     <http://github.com/npm/npm/issues>
35 error System Windows_NT 6.1.7601
36 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "cordova"
37 error cwd C:\Windows\System32
38 error node -v v0.10.32
39 error npm -v 1.4.28
40 error type unexpected_token
41 verbose exit [ 1, true ]
`

1条回答
霸刀☆藐视天下
2楼-- · 2019-09-06 07:40

The most likely explanation is that there is a proxy preventing Visual Studio from downloading the packages required to build and run Cordova apps. You need to set the proxy in npm (the Node package manager) and plugman (which downloads plugins):

npm config set proxy http://username:passwords@proxyaddress:port#

plugman config set proxy http://username:passwords@proxyaddress:port#
查看更多
登录 后发表回答