博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
cordova create 创建项目出错 (Error: Unhandled "error" event)
阅读量:6276 次
发布时间:2019-06-22

本文共 3587 字,大约阅读时间需要 11 分钟。

在家搭建cordova环境,结果。。。

cordova create创建项目一直报错

D:\appProject>cordova create appCreating a new cordova project.(node:7368) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Unhandled "error" event. (  Error from Cordova Fetch: Error: cmd: Command failed with exit code 1 Error output:npm ERR! code ENOLOCALnpm ERR! Could not install from "..\AppData\Roaming\npm\node_modules\cordova\node_modules\_cordova-app-hello-world@3.12.0@cordova-app-hello-world\index.js" as it does not contain a package.json file.npm ERR! A complete log of this run can be found in:npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2018-04-05T07_50_24_550Z-debug.log)(node:7368) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

当时的node版本是:

clipboard.png

cordova的版本是:

clipboard.png

之后我将cordova版本降到7.0

cnpm i cordova@7.0

然而...问题依旧......................................................

clipboard.png

不愿放弃的我,继续降低cordova版本,这次降低到6.0

cnpm install -g cordova@6.0.0

Downloading cordova to C:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova_tmpCopying C:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova_tmp\_cordova@6.0.0@cordova to C:\Users\Administrator\AppData\Roaming\npm\node_modules\cordovaInstalling cordova's dependencies to C:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova/node_modules[1/6] ansi@^0.3.0 installed at node_modules\_ansi@0.3.1@ansi[2/6] q@1.0.1 installed at node_modules\_q@1.0.1@q[3/6] underscore@1.7.0 installed at node_modules\_underscore@1.7.0@underscore[4/6] nopt@3.0.1 installed at node_modules\_nopt@3.0.1@nopt[5/6] update-notifier@^0.5.0 installed at node_modules\_update-notifier@0.5.0@update-notifier[6/6] cordova-lib@6.0.0 installed at node_modules\_cordova-lib@6.0.0@cordova-libdeprecate cordova-lib@6.0.0 › npmconf@^2.1.x this package has been reintegrated into npm and is now out of date with respect to npmdeprecate cordova-lib@6.0.0 › request@2.47.0 › node-uuid@~1.4.0 Use uuid module insteaddeprecate cordova-lib@6.0.0 › xcode@0.8.0 › node-uuid@1.3.3 Use uuid module insteaddeprecate cordova-lib@6.0.0 › cordova-js@4.1.3 › browserify@10.1.3 › glob@4.5.3 › minimatch@^2.0.1 Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issueRecently updated (since 2018-03-29): 5 packages (detail see file C:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova\node_modules\.recently_updates.txt)  2018-04-04    → update-notifier@0.5.0 › latest-version@1.0.1 › package-json@1.2.0 › got@3.3.1 › read-all-stream@3.1.0 › readable-stream@^2.0.0(2.3.6) (23:40:14)  2018-04-03    → cordova-lib@6.0.0 › cordova-js@4.1.3 › browserify@10.1.3 › crypto-browserify@3.12.0 › browserify-cipher@1.0.0 › browserify-aes@^1.0.4(1.2.0) (22:23:16)  2018-03-30    → update-notifier@0.5.0 › latest-version@1.0.1 › package-json@1.2.0 › got@3.3.1 › read-all-stream@3.1.0 › readable-stream@2.3.6 › string_decoder@~1.1.1(1.1.1) (16:14:15)    → cordova-lib@6.0.0 › init-package-json@1.10.3 › read-package-json@2.0.13 › json-parse-better-errors@^1.0.1(1.0.2) (23:08:03)    → cordova-lib@6.0.0 › cordova-serve@1.0.1 › express@4.16.3 › body-parser@1.18.2 › http-errors@~1.6.2(1.6.3) (04:29:06)All packages installed (340 packages installed from npm registry, used 24s, speed 811.13kB/s, json 304(2.17MB), tarball 17.12MB)[cordova@6.0.0] link C:\Users\Administrator\AppData\Roaming\npm\cordova@ -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova\bin\cordova

再次创建项目

cordova create app

clipboard.png

居然成功了!!!

clipboard.png

转载地址:http://bsfva.baihongyu.com/

你可能感兴趣的文章
/etc/fstab,/etc/mtab,和 /proc/mounts
查看>>
Apache kafka 简介
查看>>
socket通信Demo
查看>>
技术人员的焦虑
查看>>
js 判断整数
查看>>
建设网站应该考虑哪些因素
查看>>
mongodb $exists
查看>>
js实现页面跳转的几种方式
查看>>
sbt笔记一 hello-sbt
查看>>
常用链接
查看>>
pitfall override private method
查看>>
!important 和 * ----hack
查看>>
聊天界面图文混排
查看>>
控件的拖动
查看>>
svn eclipse unable to load default svn client的解决办法
查看>>
Android.mk 文件语法详解
查看>>
QT liunx 工具下载
查看>>
内核源码树
查看>>
Java 5 特性 Instrumentation 实践
查看>>
AppScan使用
查看>>