安装cordova-sqlite-storage时出错
Posted
技术标签:
【中文标题】安装cordova-sqlite-storage时出错【英文标题】:error while installing cordova-sqlite-storage 【发布时间】:2019-07-11 01:59:18 【问题描述】:我正在尝试使用以下命令在 cordova 中安装 sqlite 插件:“ionic cordova plugin add cordova-sqlite-storage”但收到错误“无法读取未定义的属性“堆栈”。
NPM 版本:3.5.2,nodejs 版本:v8.10.0,cordova 版本:8.1.2 (cordova-lib@8.1.1),离子版本:4.10.3
错误日志如下:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install' ]
2 info using npm@3.5.2
3 info using node@v8.10.0
4 silly loadCurrentTree Starting
...
623 silly idealTree:prePrune +-- fs.realpath@1.0.0
623 silly idealTree:prePrune +-- glob@7.1.3
623 silly idealTree:prePrune +-- inflight@1.0.6
623 silly idealTree:prePrune +-- inherits@2.0.3
623 silly idealTree:prePrune +-- interpret@1.2.0
623 silly idealTree:prePrune +-- minimatch@3.0.4
623 silly idealTree:prePrune +-- once@1.4.0
623 silly idealTree:prePrune +-- path-is-absolute@1.0.1
623 silly idealTree:prePrune +-- path-parse@1.0.6
623 silly idealTree:prePrune +-- rechoir@0.6.2
623 silly idealTree:prePrune +-- resolve@1.10.0
623 silly idealTree:prePrune +-- shelljs@0.8.3
623 silly idealTree:prePrune `-- wrappy@1.0.2
624 silly loadIdealTree Finishing
625 silly currentTree cordova-sqlite-storage@3.0.0
626 silly idealTree cordova-sqlite-storage@3.0.0
626 silly idealTree +-- balanced-match@1.0.0
626 silly idealTree +-- brace-expansion@1.1.11
626 silly idealTree +-- concat-map@0.0.1
626 silly idealTree +-- cordova-sqlite-storage-dependencies@2.0.0
626 silly idealTree +-- fs.realpath@1.0.0
626 silly idealTree +-- glob@7.1.3
626 silly idealTree +-- inflight@1.0.6
626 silly idealTree +-- inherits@2.0.3
626 silly idealTree +-- interpret@1.2.0
626 silly idealTree +-- minimatch@3.0.4
626 silly idealTree +-- once@1.4.0
626 silly idealTree +-- path-is-absolute@1.0.1
626 silly idealTree +-- path-parse@1.0.6
626 silly idealTree +-- rechoir@0.6.2
626 silly idealTree +-- resolve@1.10.0
626 silly idealTree +-- shelljs@0.8.3
626 silly idealTree `-- wrappy@1.0.2
627 silly generateActionsToTake Starting
628 silly install generateActionsToTake
629 verbose stack TypeError: Cannot read property 'target' of null
629 verbose stack at module.exports (/usr/share/npm/lib/install/filter-invalid-actions.js:24:36)
629 verbose stack at Array.<anonymous> (/usr/share/npm/node_modules/slide/lib/bind-actor.js:15:8)
629 verbose stack at LOOP (/usr/share/npm/node_modules/slide/lib/chain.js:15:14)
629 verbose stack at /usr/share/npm/node_modules/slide/lib/chain.js:18:7
629 verbose stack at Installer.computeLinked (/usr/share/npm/lib/install.js:411:41)
629 verbose stack at Array.<anonymous> (/usr/share/npm/node_modules/slide/lib/bind-actor.js:15:8)
629 verbose stack at LOOP (/usr/share/npm/node_modules/slide/lib/chain.js:15:14)
629 verbose stack at /usr/share/npm/node_modules/slide/lib/chain.js:18:7
629 verbose stack at module.exports (/usr/share/npm/lib/install/diff-trees.js:50:3)
629 verbose stack at Array.<anonymous> (/usr/share/npm/node_modules/slide/lib/bind-actor.js:15:8)
630 verbose cwd /home/arka/home/ionicProjects/goalTrackingApp/plugins/cordova-sqlite-storage
631 error Linux 4.15.0-45-generic
632 error argv "/usr/bin/node" "/usr/bin/npm" "install"
633 error node v8.10.0
634 error npm v3.5.2
635 error Cannot read property 'target' of null
636 error If you need help, you may report this error at:
636 error <https://github.com/npm/npm/issues>
637 verbose exit [ 1, true ]
【问题讨论】:
【参考方案1】:解决了。问题是因为安装了较旧的 npm。更新了 npm,它正在工作。
【讨论】:
以上是关于安装cordova-sqlite-storage时出错的主要内容,如果未能解决你的问题,请参考以下文章
Ionic + cordova-sqlite-storage + deviceready = 过渡时没有渲染?
我无法在 cordova-sqlite-storage 中为 ionic 1 打开数据库
在 Windows 10 中使用 cordova-plugin-file 复制 SQLite 数据库 cordova-sqlite-storage