Cordova错误:无法获取平台cordova-browser@~5.0.0

问题描述 投票:2回答:1

当我建立cordova项目它工作正常。输出也显示。但几分钟后它显示此错误

错误:无法获取平台cordova-browser@~5.0.0

    PS C:\Users\Rajadurai\Desktop\app> phonegap serve
[phonegap] starting app server...
[phonegap] listening on 127.0.0.1:3000
[phonegap]
[phonegap] ctrl-c to stop the server
[phonegap]
[phonegap] 200 /socket.io/?EIO=3&transport=polling&t=M6UXY64
[phonegap] 200 /socket.io/?EIO=3&transport=polling&t=M6UXY79&sid=rXL4l2-OqPKmfZW6AAAA
[phonegap] 200 /socket.io/?EIO=3&transport=polling&t=M6UXY7l&sid=rXL4l2-OqPKmfZW6AAAA
[phonegap] 200 /
[phonegap] 304 /socket.io/socket.io.js
[phonegap] 200 /socket.io/?EIO=3&transport=polling&t=M6UXYG2
[phonegap] 200 /socket.io/?EIO=3&transport=polling&t=M6UXYJ5&sid=zpW7GDvt1Qd-4P4fAAAB
[phonegap] 200 /socket.io/?EIO=3&transport=polling&t=M6UXYJg&sid=zpW7GDvt1Qd-4P4fAAAB
[phonegap] 200 /
[phonegap] 304 /socket.io/socket.io.js
[phonegap] 200 /
[phonegap] 200 /socket.io/?EIO=3&transport=polling&t=M6UXg9G
[phonegap] 200 /socket.io/?EIO=3&transport=polling&t=M6UXg9j&sid=c-F51GuDrgqwHErsAAAC
[phonegap] 200 /socket.io/?EIO=3&transport=polling&t=M6UXgA9&sid=c-F51GuDrgqwHErsAAAC
Using cordova-fetch for cordova-browser@~5.0.0


Error: Failed to fetch platform cordova-browser@~5.0.0
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: cmd: Command failed with exit code 1 Error output:
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! enoent request to https://registry.npmjs.org/cordova-browser failed, reason: getaddrinfo ENOENT registry.npmjs.org:443
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Rajadurai\AppData\Roaming\npm-cache\_logs\2018-02-16T12_12_00_250Z-debug.log

截图qazxsw poi请帮我解决这个问题

cordova command-line-interface phonegap
1个回答
4
投票

删除您尝试在其上运行的平台(浏览器,ios,android等)

例如(运行cmd,找到您的项目文件夹并键入):

Error screenshot

再次添加平台

cordova platform rm browser

你可以跑

cordova platform add browser
© www.soinside.com 2019 - 2024. All rights reserved.