How to install the latest 1004.x cumulocity UI package [ng1]? - cumulocity

How can I update my custom app to the latest (current 1004.x) cumulocity UI package using the old ng1 command line tools?
Updating to a previous 9.x version works fine:
>c8y install 9.20.13
Installing 9.20.13 UI Package...
npm+ cumulocity-ui-build#9.20.13
updated 1 package and audited 1 package in 30.478s
found 0 vulnerabilities
9.20.13 UI package installed
But trying to update to any version >= 1004.0 fails:
>c8y install 1004.0.6
1004.0.6 UI not found
By the way, c8y install latest always installs version 9.20.8.

Cumulocity Web SDK got migrated to ngx (Angular 2+) which means you need to upgrade your application as the old SDK and build tooling is not supported anymore. The following table gives you an overview:
So basically you can just use the tooling until version 9.25.x, afterwards you need to use the new #c8y/cli tool. More information about the migration process can be found here.
Migrating is quite easy as all ng1 plugins can be integrated into a ngx application:
npm i -g #c8y/cli install the new tooling
c8ycli new your-app-name cockpit Create a new app based on the cockpit app.
cd your-app-name && npm install open the new created folder and install the dependencies
Copy your custom plugins to the folder
Open ng1.ts and replace the not needed plugin references. Reference your custom plugins to point to the cumulocity.json manifest (e.g. import './my-plugin/cumulocity.json')
run your app locally npm start -- -u http://yourinstance.cumulocity.com
Go to your browser and check if the application work (look out for errors in the console as well!): http://localhost:9000/apps/your-app-name/
Deploy you application if everything is fine: npm run build && npm run deploy
done
Cumulocity applications after version 10.04.x.x are now running Angular (ngx) and angularjs (ngx) at the same time (so-called hybrid applications) which allows you to use the new Angular framework while you can still use your already developed plugins.

Installation steps of cumulocity UI has been changed now for version 10.4.
curl -s http://resources.cumulocity.com/webapps/ui-releases/deploy.sh | bash -s -- -u management/admin -p <password> -i <instance> -v 1004.3.0

Related

serverless AWS deployment fails because of esbuild

I'm using a Macbook M1 for development. When I try to deploy my serverless application to AWS I'm running into this error:
I'm using the aws-nodejs-typescript template.
You installed esbuild for another platform than the one you're currently using.
This won't work because esbuild is written with native code and needs to
install a platform-specific binary executable.
Specifically the "esbuild-darwin-arm64" package is present but this platform
needs the "esbuild-darwin-64" package instead. People often get into this
situation by installing esbuild with npm running inside of Rosetta 2 and then
trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta
2 is Apple's on-the-fly x86_64-to-arm64 translation service).
If you are installing with npm, you can try ensuring that both npm and node are
not running under Rosetta 2 and then reinstalling esbuild. This likely involves
changing how you installed npm and/or node. For example, installing node with
the universal installer here should work: https://nodejs.org/en/download/. Or
you could consider using yarn instead of npm which has built-in support for
installing a package on multiple platforms simultaneously.
If you are installing with yarn, you can try listing both "arm64" and "x64"
in your ".yarnrc.yml" file using the "supportedArchitectures" feature:
https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
Keep in mind that this means multiple copies of esbuild will be present.
Another alternative is to use the "esbuild-wasm" package instead, which works
the same way on all platforms. But it comes with a heavy performance cost and
can sometimes be 10x slower than the "esbuild" package, so you may also not
want to do that.
Why is this happening?
I needed to reinstall serverlesss....
for that I deleted the folder ./serverless in the directory ~
and reinstalled using homebrew
https://formulae.brew.sh/formula/serverless#default

SignalR: Cannot get js libraries in Visual Studio 2017 project

Trying to following this tutorial to get basic SignalR working:
https://learn.microsoft.com/en-us/aspnet/core/tutorials/signalr?tabs=visual-studio&view=aspnetcore-2.2
I am using Visual Studio 15.9.7
the tutorial includes the instructions below, but when I follow them, the modal window disappears without any kind of message and I do not have the signalr javascript libraries anywhere. The lib/signalr folder isn't extracted into my application. Nothing.
I looked around to try and figure out where to download them manually. Nothing.
I tried running all the Package Console commands to try and get signalR. like this one: npm install #aspnet/signalr
Nothing.
Is there an easy and proven way to just get these js libraries?
In Solution Explorer, right-click the project, and select Add > Client-Side Library.
In the Add Client-Side Library dialog, for Provider select unpkg.
For Library, enter #aspnet/signalr#1, and select the latest version that isn't preview.
Add Client-Side Library dialog - select library
Select Choose specific files, expand the dist/browser folder, and select signalr.js and signalr.min.js.
Set Target Location to wwwroot/lib/signalr/, and select Install.
Add Client-Side Library dialog - select files and destination
LibMan creates a wwwroot/lib/signalr folder and copies the selected files to it.
Firstly, you can try to update your Visual Studio and check if it can help fix the issue.
Besides, to add the SignalR client library to the project, we can also use LibMan Cli command.
Run the following command to install LibMan (if not installed it before)
dotnet tool install -g Microsoft.Web.LibraryManager.Cli
Run the following command to get the SignalR client library
libman install #aspnet/signalr -p unpkg -d wwwroot/lib/signalr --files dist/browser/signalr.js --files dist/browser/signalr.min.js

How To add CLI Workspace and Other Files to Existing Angular 5 project?

The Problem
On an existing Angular 5x application, I want to upgrade to Angular v8x and take advantage of all the sexy things, including ng generate component. I successfully modified the code to satisfy v8, and changed the npm packages correctly; the app runs (whoo-hoo!). Now, I can't get the Angular cli to work because of missing files like angular.json.
Things I've tried
Using ng new
ng new will create the project files I need, but I didn't want to overwrite my existing code, e.g. app.module.ts, so I ran
ng new my-app --directory [existing source directory of my app]
That overwrote many files, package.json, app.module.ts,etc, so I ran int again as:
ng new revenue --directory=./ --create-application=false --force
A lot of files were preserved, but package.json was not.
The Goal
Have my now upgraded app, running Angular v8, able to run fun things like ng serve
Not have to re-write package.json
Thanks for your help!
Upgrading to Angular 8 should modify package.json.
People typically use ng update to do this (link).
Updating Configuration Files
There are many differences between Angular 4|5 and Angular 6 such as
Angular 6 uses angular.json instead of angular-cli.json.
Different versions of dependencies in package.json etc.
You can update different configuration files automatically by running the following command from the project's root folder:
ng update #angular/cli
What is the ng update Command?
Ng update is a command available in Angular CLI which is used to update your application and its dependencies. You can use it to update all packages in the package.json file via the --all option that could take true or false or specific versions via the --packages option. You can see all the available commands from the official docs.
I ended up creating a brand-new application with ng new my-app, then copying over the files from the existing app. After modifying the code to work with Angular 8, using HttpClient, for example, the app successfully ran. I think I had to do it this way because of the fundamental changes to the project meta files. Hopefully, future upgrades won't be so challenging.

Google App Store Warning - You should upgrade to Apache Cordova 3.5.1 or higher as soon as possible

I have received an Email from Google Play Store for my Android App:
This is a notification that your com.mydomain.myapp, is built on a
version of Apache Cordova that contains security vulnerabilities. This
includes a high severity cross-application scripting (XAS)
vulnerability. Under certain circumstances, vulnerable apps could be
remotely exploited to steal sensitive information, such as user login
credentials. You should upgrade to Apache Cordova 3.5.1 or higher as
soon as possible. For more information about the vulnerabilities, and
for guidance on upgrading Apache Cordova, please see
http://cordova.apache.org/announcements/2014/08/04/android-351.html.
Please note, applications with vulnerabilities that expose users to
risk of compromise may be considered “dangerous products” and subject
to removal from Google Play. Regards, Google Play Team ©2014 Google
Inc. 1600 Amphitheatre Parkway Mountain View, CA 94043
If I try the command mentioned on the given link/page, i.e.:
cordova platform add android#3.5.1 --usenpm
I get an error:
Platform android already added
How can I upgrade Cordova from 3.1 to 3.5.1? I have tried all sort of things like:
npm update -g cordova
But I do not appear to be getting successful. The version file in MyApp\platforms\android\cordova folder still shows following entry and no file in this folder changes:
// Coho updates this line:
var VERSION = "3.1.0";
console.log(VERSION);
After some research, I think, I have found the solution here:
http://cordova.apache.org/index.html#download
npm install -g cordova
cd my_project
cordova platform update android
Running the last command does the trick and I get this response:
**cordova platform update android**
Deleting E:/PhoneGap/my_project/platforms/android/libs/cordova-3.1.0.jar
Android project is now at version 3.6.3
If you updated from a pre-3.2.0 version and use an IDE, we now require that you
import the "CordovaLib" library project.
Hope that helps.
Regards
If you are using Phonegap, you just need to update Phonegap to version 3.5.0
It's explained here:
http://phonegap.com/blog/2014/06/12/phonegap-3_5_release/
And here's the note from Phonegap that says how you're covered: http://phonegap.com/blog/2014/08/07/cordova-android-3_5_0-patched-with-security-fixes/

Netbeans Cannot Find Cordova or Git on your path

I just install the latest netbeans 7.4 RC1 , i got the Error page "Netbeans Cannot Find Cordova or Git on your path, Please install Cordova or Git". In fact, i actually did install both cordova and Git.
I Do follow the step on this youtube ,
https://www.youtube.com/watch?v=Gt4uHSiO-00
but it is still not allow me to open any HTML 5 cordova project.
Is that any steps i left out ?
I had the exact same problem. I found this bug: https://netbeans.org/bugzilla/show_bug.cgi?id=234870
Go to the command prompt.
Try typing:
git --version
cordova --version
If you get a "command not found" error, you have an issue with your installation. More than likely you need the items added to your path variable.
In my case, that was
C:\Users\Chris\AppData\Local\GitHub\PortableGit_015aa71ef18c047ce8509ffb2f9e4bb0e3e73f13\bin;C:\Users\Chris\AppData\Roaming\npm
for both Cordova and Git.
I think the error message logic is broken, that's why this is misleading. In my case, git wasn't in the PATH, but cordova was. Making sure git was added to the PATH, fixed this.
Had the same exact problem, looking here https://netbeans.org/bugzilla/show_bug.cgi?id=234870 this answer solved my problem:
On Windows, NetBeans tries to run "cordova.cmd -v" to check if Cordova
is ready. So I modified this cordova.cmd file to simply return fake
version:
#echo 3.0.1
this allows me to get through the wizard step, where is being checked
if Cordova is installed. After that, I revert changes in cordova.cmd
and finished new project wizard. And it worked and I can even build
and start it on Android device. This "workaround" works until I close
IDE. So the problem is only at the beginning in checking if Cordova is
installed
On command line run
where cordova
to get where it is located (usually in C:\Users\\AppData\Roaming\npm)
You have to use cordova version 3.0.10 instead of 3.1
Netbeans does not seem to work with Cordova 3.1
type in
npm install -g cordova#3.0.10
and restart Netbeans.
Be sure to check if you have any enclosures in your environment variables. I made this mistake and it gave me a lot of headache :)
Not okay: "C:\Program Files\nodejs\";C:\Program Files (x86)\Git\bin
Okay: C:\Program Files\nodejs\;C:\Program Files (x86)\Git\bin
If you install Netbeans 8 on Ubuntu 14.04, you should type
sudo ln -s /usr/bin/nodejs /usr/bin/node
then follow http://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface
I had the almost the same problem using NetBeans 8.1 on Windows 7. Except NetBeans said Cordova (only) cannot be found on my PATH but Cordova was installed and on the PATH. So like everyone suggested, I tested the versions.
C:\>git --version
git version 2.7.0.windows.2
C:\>cordova --version
? May Cordova anonymously report usage statistics to improve the tool over time? No
You have been opted out of telemetry. To change this, run: cordova telemetry on.
6.2.0
Strange, the --version asked for user input which I gave. I reopened Netbeans to find it can now magically see the install of cordova. Come to find out my whole problem was that Netbeans couldn't see it installed because Cordova was forcing user input the first time cordova --version was ran. Cordova had been freshly installed and never ran.
If anyone is using Netbeans 8.0, this is the tutorial you need to follow provided on the website of Netbeans: https://netbeans.org/kb/docs/webclient/cordova-gettingstarted.html
Happy coding with cordova...!!!
I solved this problem with installing GIT from this link :
http://git-scm.com/book/en/Getting-Started-First-Time-Git-Setup
hope this help someone.
I had the same problem. I found the one solution on another site.
Try this: re-install git and choose the option *Use Git and optional Unix tools from the windows Command Prompt.
Just follow the installation process as describe in phonegap(cordova) documentation but make sure when you are installing git you checked the option use git and optional Unix tools from the windows command prompt after that go to path variable check that C:\Program Files\nodejs\;C:\Program Files
(x86)\Git\bin exists in your path environment variable as shrty has said.
You can test if node.js is install by node --version and git by git --version
Get the path where npm install -g cordova installed your
cordova. It produces something like "} (current: {"node":"0.10.36","npm":"1.4.28"})
C:\Users\kanu\AppData\Roaming\npm\cordova ->: if you go in
C:\Users\kanu\AppData\Roaming\npm\ directory you'll find cordova.exe there
What you have to do is to add ;C:\Users\magezi\AppData\Roaming\npm\ in environment after the git's one.
After that change the directory to where cordova.exe exists for me it was in C:\Users\kanu\AppData\Roaming\npm\ and from there you can test the installation of cordova by the command cordova --version(it will return the version)
open netbeans and try to create an cordova application. It should work
I had the same issue under linux, and was tinkering around with the user specific $PATH. What solved it eventually was to set the $PATH variable in the netbeans.conf located at $NETBEANS_PATH/etc/netbeans.conf
I added these three lines
export ANDROID_HOME=/home/paul/Android/Sdk
PATH="$PATH:/home/paul/opt/node-v4.4.7-linux-x64/bin/:/home/paul/Android/Sdk/tools"
export PATH
Afterwards I was finally able to setup any Cordova project :)