becvert / cordova-plugin-zeroconf

Cordova ZeroConf Plugin
MIT License
81 stars 57 forks source link

Add plugin failed when npm@5 #43

Closed NeoLSN closed 7 years ago

NeoLSN commented 7 years ago

It will fail because the cordova-plugin-add-swift-support dependency. Maybe you can also add the version in the dependency.

Seems this issue is the same as: https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/pull/849

NeoLSN commented 7 years ago

@becvert Could you add this in the plugin xml and also publish a new version? I think it would be very helpful for those who just is starting a new project and using this plugin.

becvert commented 7 years ago

I'll do that when I can 😉

becvert commented 7 years ago

I could not reproduce the issue (cordova 7, node 6.11.2, npm 5.4.0):

cordova create .
cordova platform add ios
cordova platform add android
cordova plugin add cordova-plugin-zeroconf

I'll add the version number anyway because it is good practice.

NeoLSN commented 7 years ago

Most of case is caused when restoring platform from repository,

Discovered plugin "cordova-plugin-zeroconf" in config.xml. Adding it to the project
        Installing "cordova-plugin-zeroconf" for ios
        Failed to install 'cordova-plugin-zeroconf': Error
             at
        /Users/JasonYang/.nvm/versions/node/v8.2.0/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:205:33
             at _rejected
        (/Users/JasonYang/.nvm/versions/node/v8.2.0/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:864:24)
             at
        /Users/JasonYang/.nvm/versions/node/v8.2.0/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:890:30
             at Promise.when
        (/Users/JasonYang/.nvm/versions/node/v8.2.0/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:1142:31)
             at Promise.promise.promiseDispatch
        (/Users/JasonYang/.nvm/versions/node/v8.2.0/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:808:41)
             at
        /Users/JasonYang/.nvm/versions/node/v8.2.0/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:624:44
             at runSingle
        (/Users/JasonYang/.nvm/versions/node/v8.2.0/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:137:13)
             at flush
        (/Users/JasonYang/.nvm/versions/node/v8.2.0/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:125:13)
             at _combinedTickCallback (internal/process/next_tick.js:131:7)
             at process._tickCallback (internal/process/next_tick.js:180:9)
        Failed to restore plugin "cordova-plugin-zeroconf" from config.xml. You might need to try adding it again.
        Error: Failed to fetch plugin cordova-plugin-add-swift-support via registry.
becvert commented 7 years ago

release 1.2.7 is online. please close this issue if it's fine for you.

NeoLSN commented 7 years ago

Yes, it worked. Thank you.