Cordova和Ionic不在OS X Capitan(版本10.11.1)下安装

时间:2015-11-15 21:12:39

标签: node.js xcode cordova osx-elcapitan

我最近将Mac更新为OS X El Capitan(版本10.11.1),现在我的cordova和离子安装出现问题。两者都在优胜美地之下运行良好。

$ npm –v
节目 $ 3.3.12

$ node 节目 $ v5.0.0

$ sudo npm install –g cordova ionic 节目 $ npm ERR! addLocal Could not install /Applications/Xcode.app/–g $ npm ERR! Darwin 15.0.0 $ npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "–g" "cordova" "ionic" $ npm ERR! node v5.0.0 $ npm ERR! npm v3.3.12 $ npm ERR! path /Applications/Xcode.app/–g $ npm ERR! code ENOENT $ npm ERR! errno -2 $ npm ERR! syscall open $ $ npm ERR! enoent ENOENT: no such file or directory, open '/Applications/Xcode.app/–g' $ npm ERR! enoent This is most likely not a problem with npm itself $ npm ERR! enoent and is related to npm not being able to find a file. $ npm ERR! enoent $ $ npm ERR! Please include the following file with any support request: $ npm ERR! /Applications/Xcode.app/npm-debug.log

此日志文件的内容:

0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', 1 verbose cli '/usr/local/bin/npm', 1 verbose cli 'install', 1 verbose cli '–g', 1 verbose cli 'cordova', 1 verbose cli 'ionic' ] 2 info using npm@3.3.12 3 info using node@v5.0.0 4 silly loadCurrentTree Starting 5 silly install loadCurrentTree 6 silly install readLocalPackageData 7 silly fetchPackageMetaData –g 8 silly fetchPackageMetaData cordova 9 silly fetchPackageMetaData ionic 10 silly fetchOtherPackageData –g 11 silly cache add args [ '–g', null ] 12 verbose cache add spec –g 13 silly fetchNamedPackageData cordova 14 silly mapToRegistry name cordova 15 silly mapToRegistry using default registry 16 silly mapToRegistry registry https://registry.npmjs.org/ 17 silly mapToRegistry uri https://registry.npmjs.org/cordova 18 silly fetchNamedPackageData ionic 19 silly mapToRegistry name ionic 20 silly mapToRegistry using default registry 21 silly mapToRegistry registry https://registry.npmjs.org/ 22 silly mapToRegistry uri https://registry.npmjs.org/ionic 23 silly cache add parsed spec Result { 23 silly cache add raw: '–g', 23 silly cache add scope: null, 23 silly cache add name: null, 23 silly cache add rawSpec: '–g', 23 silly cache add spec: '/Applications/Xcode.app/–g', 23 silly cache add type: 'local' } 24 error addLocal Could not install /Applications/Xcode.app/–g 25 silly fetchPackageMetaData Error: ENOENT: no such file or directory, open '/Applications/Xcode.app/–g' 25 silly fetchPackageMetaData at Error (native) 25 silly fetchPackageMetaData error for –g { [Error: ENOENT: no such file or directory, open '/Applications/Xcode.app/–g'] 25 silly fetchPackageMetaData errno: -2, 25 silly fetchPackageMetaData code: 'ENOENT', 25 silly fetchPackageMetaData syscall: 'open', 25 silly fetchPackageMetaData path: '/Applications/Xcode.app/–g' } 26 verbose request uri https://registry.npmjs.org/cordova 27 verbose request no auth needed 28 info attempt registry request try #1 at 16:52:51 29 verbose request id 37de52bb0c078959 30 verbose etag "3I2GKY5YJDCEH0E25NKOJONR5" 31 http request GET https://registry.npmjs.org/cordova 32 verbose request uri https://registry.npmjs.org/ionic 33 verbose request no auth needed 34 info attempt registry request try #1 at 16:52:51 35 verbose etag "D4ZWHYNBKT52VU9GGXKKX7DYM" 36 http request GET https://registry.npmjs.org/ionic 37 http 400 https://registry.npmjs.org/ionic 38 verbose headers {} 39 silly get cb [ 304, undefined ] 40 verbose etag https://registry.npmjs.org/ionic from cache 41 verbose get saving ionic to /Users/dirk/.npm/registry.npmjs.org/ionic/.cache.json 42 http 400 https://registry.npmjs.org/cordova 43 verbose headers {} 44 silly get cb [ 304, undefined ] 45 verbose etag https://registry.npmjs.org/cordova from cache 46 verbose get saving cordova to /Users/dirk/.npm/registry.npmjs.org/cordova/.cache.json 47 silly rollbackFailedOptional Starting 48 silly rollbackFailedOptional Finishing 49 silly runTopLevelLifecycles Starting 50 silly runTopLevelLifecycles Finishing 51 silly install printInstalled 52 verbose stack Error: ENOENT: no such file or directory, open '/Applications/Xcode.app/–g' 52 verbose stack at Error (native) 53 verbose cwd /Applications/Xcode.app 54 error Darwin 15.0.0 55 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "–g" "cordova" "ionic" 56 error node v5.0.0 57 error npm v3.3.12 58 error path /Applications/Xcode.app/–g 59 error code ENOENT 60 error errno -2 61 error syscall open 62 error enoent ENOENT: no such file or directory, open '/Applications/Xcode.app/–g' 62 error enoent This is most likely not a problem with npm itself 62 error enoent and is related to npm not being able to find a file. 63 verbose exit [ -2, true ]

提前致谢!

1 个答案:

答案 0 :(得分:0)

我在10.11.1上运行了cordova和Ionic,没有任何问题 节点是5.10 npm是3.3.12(因为3.4.1崩溃了cordova) 离子是1.7.10 cordova是5.4.0

所有在安装10.11.1之后通过终端使用npm安装。 话虽如此,XCode也已下载并安装, 建议从节点站点下载安装程序中删除并重新安装节点和npm。这就是我遵循的道路。