Techvenience

Technology × Convenience - Vue / React / Next / Nuxt / ChatGPTなどのIT技術がもたらす便利さをお伝えします。最近はChatGPTなどのAI技術を使ってブログを書いています。

【ハイブリッドアプリ】MacでCordovaでの開発環境を整える② -エラー対処の続き-

前回記事から引き続き、開発環境の構築。

ちなみにブログは備考録的に使っているため、まとまっていないので読みにくいと思う。ある程度、進展があった段階でまとめページを作成(wikiで作成検討)する予定なので、乞うご期待。

f:id:duo-taro100:20160218004611p:plain

昨日やったものを無かったことにして、最初からやり直した。

 

node.jsインストールからやり直し。昨日とは異なるバージョンをインストール。

まずはnode.jsやnpm、cordovaをアンインストール
 
再度インストール。
 
バージョン確認

$ node -v

v4.3.1

$ npm -v

2.14.12

 

 

続いて、Cordovaのインストール

f:id:duo-taro100:20160218004753j:plain

sudo npm install -g cordova

 

昨日は出なかったWARNがでた。

npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm

/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova

npm WARN unmet dependency/usr/local/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk requires assert-plus@'>=0.2.0 <0.3.0' but will load

npm WARN unmet dependency/usr/local/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus,

npm WARN unmet dependency which is version 0.1.5

npm WARN unmet dependency/usr/local/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash requires assert-plus@'^0.2.0' but will load

npm WARN unmet dependency/usr/local/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus,

npm WARN unmet dependency which is version 0.1.5

cordova@6.0.0 /usr/local/lib/node_modules/cordova

├── underscore@1.7.0

├── q@1.0.1

├── ansi@0.3.1

├── nopt@3.0.1 (abbrev@1.0.7)

├── update-notifier@0.5.0 (is-npm@1.0.0, semver-diff@2.1.0, repeating@1.1.3, string-length@1.0.1, chalk@1.1.1, configstore@1.4.0, latest-version@1.0.1)

└── cordova-lib@6.0.0 (opener@1.4.1, valid-identifier@0.0.1, cordova-registry-mapper@1.1.15, unorm@1.3.3, properties-parser@0.2.3, semver@4.3.6, dep-graph@1.1.0, nopt@3.0.6, shelljs@0.3.0, xcode@0.8.0, elementtree@0.1.6, npmconf@2.1.2, glob@5.0.15, request@2.47.0, cordova-serve@1.0.0, tar@1.0.2, aliasify@1.9.0, cordova-app-hello-world@3.10.0, init-package-json@1.9.3, plist@1.2.0, cordova-js@4.1.3, npm@2.14.20)

 

 

 

これはスルーしたらまずいかな、と思いつつCordovaのバージョン確認

f:id:duo-taro100:20160214124138j:plain

 

$ cordova -v

 

module.js:327

    throw err;

    ^

 

Error: Cannot find module 'bplist-parser'

    at Function.Module._resolveFilename (module.js:325:15)

    at Function.Module._load (module.js:276:25)

    at Module.require (module.js:353:17)

    at require (internal/module.js:12:17)

    at Object.<anonymous> (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js:20:14)

    at Module._compile (module.js:409:26)

    at Object.Module._extensions..js (module.js:416:10)

    at Module.load (module.js:343:32)

    at Function.Module._load (module.js:300:12)

    at Module.require (module.js:353:17)

 

    at require (internal/module.js:12:17)

 

 

昨日とほぼ同じエラー。

ということはCordovaインストールがやはりうまくいっていないのだろう。

 

$ npm list

 

 

で確認。

 

npm ERR! missing: bplist-parser@^0.1.0, required by cordova-common@1.0.0

npm ERR! missing: osenv@^0.1.3, required by cordova-common@1.0.0

npm ERR! extraneous: lodash.repeat@3.1.0 /usr/local/lib/node_modules/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat

npm ERR! extraneous: es6-symbol@3.0.2 /usr/local/lib/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol

npm ERR! extraneous: lodash.repeat@3.1.1 /usr/local/lib/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat

npm ERR! extraneous: process-nextick-args@1.0.6 /usr/local/lib/node_modules/npm/node_modules/readable-stream/node_modules/process-nextick-args

npm ERR! extraneous: util-deprecate@1.0.2 /usr/local/lib/node_modules/npm/node_modules/readable-stream/node_modules/util-deprecate

npm ERR! invalid: assert-plus@0.1.5 /usr/local/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus

npm ERR! extraneous: jsprim@1.2.2 /usr/local/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim

npm ERR! extraneous: sshpk@1.7.3 /usr/local/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk

npm ERR! extraneous: is-typedarray@1.0.0 /usr/local/lib/node_modules/npm/node_modules/request/node_modules/is-typedarray

npm ERR! extraneous: aws4@1.2.1 /usr/local/lib/node_modules/npm/node_modules/request/node_modules/aws4

npm ERR! extraneous: isexe@1.1.1 /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe

npm ERR! extraneous: aproba@1.0.1 /usr/local/lib/node_modules/npm/node_modules/aproba

npm ERR! extraneous: debuglog@1.0.1 /usr/local/lib/node_modules/npm/node_modules/debuglog

npm ERR! extraneous: has-unicode@2.0.0 /usr/local/lib/node_modules/npm/node_modules/has-unicode

npm ERR! extraneous: iferr@0.1.5 /usr/local/lib/node_modules/npm/node_modules/iferr

npm ERR! extraneous: imurmurhash@0.1.4 /usr/local/lib/node_modules/npm/node_modules/imurmurhash

npm ERR! extraneous: lodash._baseindexof@3.1.0 /usr/local/lib/node_modules/npm/node_modules/lodash._baseindexof

npm ERR! extraneous: lodash._baseuniq@3.0.3 /usr/local/lib/node_modules/npm/node_modules/lodash._baseuniq

npm ERR! extraneous: lodash._bindcallback@3.0.1 /usr/local/lib/node_modules/npm/node_modules/lodash._bindcallback

npm ERR! extraneous: lodash._cacheindexof@3.0.2 /usr/local/lib/node_modules/npm/node_modules/lodash._cacheindexof

npm ERR! extraneous: lodash._createcache@3.1.2 /usr/local/lib/node_modules/npm/node_modules/lodash._createcache

npm ERR! extraneous: lodash._getnative@3.9.1 /usr/local/lib/node_modules/npm/node_modules/lodash._getnative

npm ERR! extraneous: lodash.isarguments@3.0.6 /usr/local/lib/node_modules/npm/node_modules/lodash.isarguments

npm ERR! extraneous: lodash.isarray@4.0.0 /usr/local/lib/node_modules/npm/node_modules/lodash.isarray

npm ERR! extraneous: lodash.keys@4.0.2 /usr/local/lib/node_modules/npm/node_modules/lodash.keys

npm ERR! extraneous: lodash.restparam@3.6.1 /usr/local/lib/node_modules/npm/node_modules/lodash.restparam

npm ERR! extraneous: read-cmd-shim@1.0.1 /usr/local/lib/node_modules/npm/node_modules/read-cmd-shim

npm ERR! extraneous: read-package-tree@5.1.2 /usr/local/lib/node_modules/npm/node_modules/read-package-tree

npm ERR! extraneous: readdir-scoped-modules@1.0.2 /usr/local/lib/node_modules/npm/node_modules/readdir-scoped-modules

npm ERR! extraneous: unpipe@1.0.0 /usr/local/lib/node_modules/npm/node_modules/unpipe

npm ERR! extraneous: unique-filename@1.1.0 /usr/local/lib/node_modules/npm/node_modules/unique-filename

npm ERR! extraneous: lodash.clonedeep@4.0.4 /usr/local/lib/node_modules/npm/node_modules/lodash.clonedeep

npm ERR! extraneous: lodash.union@4.0.2 /usr/local/lib/node_modules/npm/node_modules/lodash.union

npm ERR! extraneous: lodash.uniq@4.0.2 /usr/local/lib/node_modules/npm/node_modules/lodash.uniq

 

npm ERR! extraneous: lodash.without@4.0.2 /usr/local/lib/node_modules/npm/node_modules/lodash.without

エラーが。実は昨日もこれと同じ流れで問題解決に挑んだが、解決できなかった。

今回はnode.jsのバージョンが違うからなのかエラーが増えていた。

 

明日は休みなので、もうちょっとやってみる。

 

つづく。

f:id:duo-taro100:20160218004600p:plain