I have a local plugin, which I'm trying to install to a Cordova project. Adding it through VS works like a charm, but when I'm building it, plugman tries to retrieve the plugin from the registry (npm http GET http://registry.cordova.io/[Plugin]/[Version]) and the build fails, because this plugin only exist locally.
Anyone got clue, how to make plugman fetch the plugin from the local path?
A significant changed that occurred with Cordova 5.0.0 is that plugins are now starting to move to npm. Unfortunately Cordova 4.3.1 and below do not support npm based plugins.
As a result, what you may be running into is this situation where the plugin references something in npm. This article has tips and workarounds for dealing with this problem when using Cordova 4.3.1 or below.
Note that you can use Cordova 5.0.0+ with Visual Studio 2015, but 5.0.0 has a known problem with Ripple along with an Android security issue that has been resolved in Cordova 5.1.1. I'd use Cordova 5.1.1 instead of 5.0.0. Note that VS will still build with Ant instead of Gradle in 2015 RC and some plugins may require Gradle. (This will be resolved in an upcoming update.)
Related
I'm trying to work on a really old cordova project(cordova 4.2.0) in Windows. In order to build the project I need an appropriate Node version.
I have tried a few versions from the distributions page by basically hit and trial but in vain. The error is the same.
404 for cordova repository www
Which version of node would work with cordova 4.2.0?
Screenshot here:
You have installed cordova 4.0.0 on machine, but your project requires and try to download 3.6.3, but that version is no longer present on npm package.
Use
npm show cordova#* version on console to show all available versions of Cordova, then upgrade your project to the nearest one (es. 4.0.0).
I could really use someone's help on this as I have been troubleshooting this for a really long time now with no remediation.
The issue is simply installing the NativeScript CLI onto my OSX Yosemite Mac. I followed the steps according to NS' website (installing proper Node.JS version, downloaded Xcode 7.2 (due to OS constraints), installed JSDK, installed NS Sidekick, installed Android Studio w/ proper SDK along with every other required dependancy.
However, when I run "sudo npm i -g nativescript --unsafe-perm" (otherwise it will throw a EACCES error), I get the following log with it saying I missing all of these dependencies I know I have but it is claiming I don't.
The biggest kick is that while it still will say NativeScript successfully installed, whenever I run any tns command (like tns doctor), the bash command cannot be found.
I have made sure to follow the directions of adding NS to my path as well as my Android and Java SDKs. Here is the full log:
jsmbp:~ Js$ sudo npm i -g nativescript --unsafe-perm
Password:
/Users/Jmsquillaro/.npm-packages/bin/nativescript -> /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/bin/tns
/Users/Jmsquillaro/.npm-packages/bin/tns -> /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/bin/tns
> fsevents#1.1.2 install /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/node_modules/fsevents
> node install
[fsevents] Success: "/Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
> nativescript#3.3.1 postinstall /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript
> node postinstall.js
WARNING: adb from the Android SDK is not installed or is not configured properly.
For Android-related operations, the NativeScript CLI will use a built-in version of adb.
To avoid possible issues with the native Android emulator, Genymotion or connected
Android devices, verify that you have installed the latest Android SDK and
its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
TIP: To avoid setting up the necessary environment variables, you can use the Homebrew package manager to install the Android SDK and its dependencies.
WARNING: The Android SDK is not installed or is not configured properly.
You will not be able to build your projects for Android and run them in the native emulator.
To be able to build for Android and run apps in the native emulator, verify that you have
installed the latest Android SDK and its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
TIP: To avoid setting up the necessary environment variables, you can use the Homebrew package manager to install the Android SDK and its dependencies.
WARNING: CocoaPods is not installed or is not configured properly.
You will not be able to build your projects for iOS if they contain plugin with CocoaPod file.
To be able to build such projects, verify that you have installed CocoaPods.
The ANDROID_HOME environment variable is not set or it points to a non-existent directory. You will not be able to perform any build-related operations for Android.
To be able to perform Android build-related operations, set the ANDROID_HOME variable to point to the root of your Android SDK installation directory.
Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 22 or later.
Run $ sdkmanager to manage your Android SDK versions.
You need to have the Android SDK Build-tools installed on your system. You can install any version in the following range: '>=23 <=26'.
Run $ sdkmanager from your command-line to install required Android Build Tools. In case you already have them installed, make sure ANDROID_HOME environment variable is set correctly.
You need to have Android SDK 22 or later and the latest Android Support Repository installed on your system.
Run $ sdkmanager to manage the Android Support Repository. In case you already have it installed, make sure ANDROID_HOME environment variable is set correctly.
Error executing command 'javac'. Make sure you have installed The Java Development Kit (JDK) and set JAVA_HOME environment variable.
You will not be able to build your projects for Android.
To be able to build for Android, verify that you have installed The Java Development Kit (JDK) and configured it according to system requirements as
described in http://docs.nativescript.org/setup/ns-cli-setup/ns-setup-os-x.html#system-requirements
There seem to be issues with your configuration.
? Do you want to visit the official documentation? No
? Do you want to run the setup script? No
Your components are up-to-date:
nativescript,tns-core-modules,tns-android,tns-ios
Autocompletion is already enabled
Installation successful. You are good to go. Connect with us on http://twitter.com/NativeScript.
+ nativescript#3.3.1
added 692 packages in 156.18s
jsmbp:~ Js$ tns doctor
-bash: tns: command not found
What can I do to fix this? npm also declares "rollbackFailedOptional" every time I try to reinstall after I uninstall it. Is npm caching a broken version and can I force it to do a genuine "reinstall?" It has been so frustrating as everything looks messed up and I really don't want to give up on NS. Let me know your thoughts and thank you!
Begin by installing node.js correctly. I've you are having to you --unsafe-perm that means, the node.js installation is not done right.
I suggest you install nvm using homebrew and then install node from that. Please refer to my solution in this post https://discourse.nativescript.org/t/not-installing-on-macos/3292/4
I have a Cordova application and want to add a plugin to my Cordova project. It worked yesterday!
What I did:
Updated Android Studio to 3.x
Updated Cordova
If I want use the cordova add command, I get this error:
What should I do?
Hard Reset it: Try to remove that plugin you installed yesterday, maybe do a clean install of Cordova or update all dependencies and add missing through Gradle and then finally go for installing the plugins. Somehow, I feel that Cordova version or some dependency mismatch is giving birth to such problems.
I use visual studio 2015 to create a mobile app using javascript apache cordova app. but when I want to build it , I got two errors:
Error installing local npm package.
and this error :
Could not find module 'C:\Users\rayban pc\AppData\Roaming\npm\node_modules\vs-tac\app.js'. Please Go to Tools --> Options --> Tools for Apache Cordova --> Cordova Tools --> Clear Cordova Cache and try building again
I clear cache , but error occur again.
I set environment variables for android sdk , java , ant and node.js correctly.
please help me solve this error.
What update of TACO are you on? Earlier versions of TACO sometimes have npm and Node versioning issues. Update to the latest version (VS15, Update 8) http://taco.visualstudio.com/en-us/docs/release-update-8/, which sandboxes Node and npm. After you update, try to build a new blank project.
My Problem Solve when I update my android sdk and get all version of sdk.
We have downloaded and installed a different Npm instance outside Visual Studio on our development machine and set the system classpath to use this version;
using this Npm, we have downloaded the latest version of Cordova (3.5.0).
Apparently, it seems that Visual Studio 2013 is using this new Npm installation and Cordova version when building; using this configuration we can correctly build and deploy to WP8, Android and iOS.
Also the plugins (enabled from the config.xml in VS) are downloaded and set in the new Cordova path.
Looking at the build log, I've however noticed that the iOS build is reporting that the 3.4.0 version of Cordova is used.
Is this kind of configuration supported?
Which is the correct way to use a different version of Cordova?
If you update Multi-Device Hybrid Apps to the CTP2, Visual Studio now uses Cordova 3.5.0 instead of 3.4.1. You should also update your instance of vs-mda-remote on your Mac to stay in sync for iOS.
There is currently not a supported way to select a version of Cordova though that is on the roadmap.