error building phonegap application : Error installing local npm package - node.js

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.

Related

Update Node.js & Cordova in Visual Studio 2017

I'm trying to update nodejs and cordova.
In got the latest version of nodejs and installed it into c:\program files\nodejs
However there is some conflict when i try to install cordova
npm install -g cordova
Npm shows the version installed in visual studio and closes:
c:\ProgramData\Microsoft\VisualStudio\MDA\3614fb17\taco-toolset-6.3.1\node_modules
I tried most of the solution found on stackoverflow and many others on google nothing. manual change of the version in config.xml will simply crash the app and thats all.
How to update it?
Best solution as far.
I gave up on visual studio and using my good old Edit Plus IDE and using cordova in command line to build / run etc.

Visual Studio 2015 - Cordova - Build issue, cause vs-tac/app.js not found

Versions
Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586
VS TACO Update 10
TypeScript 2.4.1
What i have done
i set External tools to global nodejs
https://i.stack.imgur.com/PRqR8.jpg
i changed cordova cli from 6.3.1 to 6.5.0... using the article of the taco page.
3.i used cmd to navigate to the cordova project folder in my solution like "D:\Projects\XYZ\LM\LM.CordovaApp (LM.Cordova is project in VS2015 solution). then i try to update my cordova-android (it installed version6.2.3). i'm used the commands:
cordova platform remove android
cordova platform install android
Errors
After Build:
MSBUILD : cordova-build error BLD401: Error : BLD00401 : Could not find module 'D:\Projects\XYZ\LM\LM.CordovaApp\node_modules\vs-tac\app.js'. Please Go to Tools --> Options --> Tools for Apache Cordova --> Cordova Tools --> Clear Cordova Cache and try building again.
this is not exactly the same error like this "Could not find module ‘C:\Users{name}\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", which i can find many solutions, but my error doesn't point to the global npm node_modules, it points to the node_modules of my project and in my global Roaming\npm\node_modules is a vs-tac directory.
Clear Cordova Cache doesn't help.
Clear npm cache + Cordova Cache doesn't help.
after looked over this page "https://decoupledlogic.com/2016/05/11/fixed-error-building-cordova-in-visual-studio/", i had an idea... i add to my package.json of the project the dependency:
"vs-tac": "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\ApacheCordovaTools\\Packages\\vs-tac"
now i restored package, rebuild and the error changed....to:
BLD00401 : Could not find module 'elementtree'. Please Go to Tools --> Options --> Tools for Apache Cordova --> Cordova Tools --> Clear Cordova Cache and try building again.
but i can ses in my project node_modules the directory "elementtree"....
Clean Cordova Cache doesn't help.
no i'm out of ideas.
have anyone a idea or solution??? how can update cordova-cli and cordova platforms of a Visual Studio Cordova Project correctly?
actually i rolled back to cordova-cli 6.3.1 and the old platform versions...

Unable to add plugins to cordova project. npm error?

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.

Ionic setup issues on Windows 7

I am trying to install Ionic on Windows 7 machine.
First, installed NodeJS 6.1.0, It went fine
Then, ran npm install -g cordova, Went fine
Then, ran npm install -g ionic, Got error related to Python.
Installed Python 2.7
Again, ran npm install -g ionic, Got error related to Microsoft .Net
Framework 2 SDK.
Updated npm to 3.8.9, Still getting error related to Microsoft .Net
Framework 2 SDK.
Are Python and Microsoft .Net SDK actually required? Nowhere I could find about this in the installation guides.
no python and .net SDK are not required
you need to download Android SDK in the case of developing for android.
you can download android studio and download SDK from SDK MANAGER or simply download android SDK. In my case, I download the android studio and then used the SDk manager to download the SDK's.
You can download it from here Android SDK
Also ou need to have JAVA jdk installed on your system and you have to set
PATH for both android sdk , java and nodejs
add PATH in system variables to environment variable
to
C:\Program Files\nodejs\
C:\Users**SystemName**\AppData\Local\Android\android-sdk\tools
C:\Users**SystemName**\AppData\Local\Android\android-sdk\platform-tools
C:\Program Files\Java\jdk1.7.0_79\bin
the above paths are according to my system. The SystemName may differ on your system else will be the same.
You also need to set User Variable jsut above your system variable:
ANDROID_HOME : C:\Users\SystemName\AppData\Local\Android\android-sdk
JAVA_HOME : C:\Program Files\Java\jdk1.7.0_79
you may also need to install gradle using nodejs command
and add its user variable and system variable
like
GRADLE_HOME :C:\Program Files\gradle-2.9
same in system variable(i.e PATH)
But first of all you need to download Node.js
I tried v6.0.1 but it is not compatible for ionic 2 for now, so you can download v4.4.x or v5.x from Node js site(sorry dont have 10 repo poits to post the third link) for now and later use v6.0.x
now using nodejs command prompt you need to install npm http://blog.npmjs.org/post/85484771375/how-to-install-npm
after installing npm
install ionic 2 and cordova using
npm install -g ionic#beta cordova
now Ionic is installed on your system.
To start a new project
ionic start Myproject --v2
and if you want to start a ionic project using typescript
ionic start Myproject --v2 --ts
Now give command
cd Myproject
to go to the directory of your project
after that, to test your app use
ionic serve

VS 2015 RC - Trying to fetch local plugin from remote registry

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.)

Resources