我正在尝试使用以下命令在cordova中安装sqlite插件:“ ionic cordova plugin add cordova-sqlite-storage”,但收到错误消息“无法读取未定义的属性” stack”。
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 ]
答案 0 :(得分:1)
解决了。问题是由于安装了较旧的npm。更新了npm并且它正在工作。