Nexus equivalent for web development - web

I've been using Maven and Nexus for Java backend development for quite some time, with very good results.
With web development, I started using the "usual suspects": Bower, Yeoman, NPM, Grunt, ...
What is the best way to managed project dependencies? I'd love to install a Nexus equivalent that would allow me not to download the dependencies for each project.
Thanks for your help! :)

I've not tried that, but bower can do that. You can host a private bower registry.
Here is some links you could be interrested with :
http://toranbillups.com/blog/archive/2013/08/04/How-to-host-a-private-bower-registry/
https://github.com/bower/registry

For your NPM needs you can continue to use Nexus, as NPM support is part of Nexus OSS and PRO and allows for proxying, hosting and grouping. Check out the documentation and a video demo for more information.

Related

NPM CI Cross-Platform Reliability

Our NodeJS application should run on Linux and Windows servers. We have the following dilemma:
If we run npm i as our CI Build then we sometimes get errors due to differences between the developers laptop's NPM and the build server.
However, if we run npm ci then the build will presumably be locked to the platform of the developers laptop (Windows) and not work on a linux build server.
Maybe our assumptions are incorrect:
Do we need to build 2 versions of our app: one for each platform?
Does npm ci lock us into the platform of the developer's machine through package-lock.json?
Examples of builds working on developers Windows laptops and on Windows servers but not on a Linux server are apps like strapi or packages like sharp which compile stuff for the platform (.dlls for windows, godknowswhat for linux).
Apparently there is no portable way to create a portable node_modules folder, even if all dependencies are pure javascript ones.
I found this the hard way as it seems that npm created different scripts on Windows, like ones ending in .ps1, something that does not happen on POSIX platforms.
That means, that no way to track node_modules in git either.

How to freeze all Cordova dependencies?

I'm building a Cordova app where tight control over the build environment is part of the spec/business requirements.
I'd like to (a) figure out the version and binary file and url for EVERY dependency, and (b) make sure they NEVER update automatically.
I'd like to use this to set up a Docker image for a build, and/or a local mirror of all dependencies. If the Docker image can be regenerated from the mirror that is best; if the Docker image works fine without a network connection (including cordova platform rm/add...) that is a close second.
Unfortunately, the number of dependencies (including dependencies of dependencies etc) is massive, and worse, there are many completely different kinds of packages with different package management systems.
Some of the things I know about:
npm packages -> list in package.json, installed in node_modules/, downloaded from npmjs.com
cordova platforms -> list in config.xml, installed in platforms/ (from npm?)
cordova plugins -> list in config.xml, installed in plugins/ (from npm?)
gradle? from https://services.gradle.org/distributions/
bintray packages?
maven packages?
for Android - platform-tools, build-tools etc, downloaded using tools/bin/sdkmanager from ?
for iOS - Xcode and a bunch of other things?
How can I get a handle on all of these? Is this an already solved problem (and how)?
It seems like this would be something that everyone who cares about versioning but wants to use Javascript/Node-type tools would need to solve; however there seems to be an almost total lack of documentation on it.

Does it matter what versions of Angular third party modules installed via npm use?

I have an Ionic4 app using the most current version of Angular7. I installed a few node modules from third parties via npm install --save. The npm modules I installed via npm use Angular4 (when I look through the modules package.json on git), but my main Ionic app uses Angular7. Am I using 2 versions of Angular in my Ionic app and bloating it?
The simply answer is no, it doesnt matter what version of angular third party vendors use. Generally if a library how built using Angular 4 it can be consumed in an newer version of Angular eg) v6, v7 etc. One thing to look out for is the packages that you are consuming in your application, if a package was built with Angular 4 its a high possibility it contains other dependencies that was used and in some cases those packages that were used to build that library may come up as deprecated in newer versions of Angular.
To answer your comment, the answer is yes again; generally if you are using a newer version of Angular you should use the newer packages but if you do use a library that uses an older package, angular will adapt to the specification of that particular package.
Mark as answer is it helped, thank you.
IMPORTANT* when you are upgrading from the current version of angular to an advanced one, you should always install (using NPM install) the angular libraries first and only then the third party packages otherwise it could stuck your installation process and give you strange 'gyp-node' errors.
I think your app is working because ionic was made out of angular, as far as i know, one thing i could recommend to you, apart from the fact that you are asking one thing on the title of your question and then asking something else on your description, is to use NVM.
Stuff like angular, npm and ionic will be linked to your node version, so you could work with two different versions of node and all of the other stuff will not get mixed up, i really hope this helps you a little.

How to set Node.js and NPM version numbers in a hosted VSO Build Agent?

In Visual Studio Online you can now set build dependencies on the General tab of a build definition.
But.. is there a way to set the version of Node.js and NPM?
It seems like a hosted build agent is currently using Node.js v0.12.7 and NPM v2.11.3 but I need Node.js v4.2+ and NPM v3.3+. Is there a way to enforce it?
P.S.: On-premise VSO build agent is not an option.
There is now a Node Tool installer available. The link to software inventory shared by Daniel was very helpful, and I discovered the installer digging into the Node specs for Hosted VS2017 agent.
Finds or downloads and caches the specified version of Node.js and adds it to the PATH
Try adding a Node Tool installer step before your node/npm steps.
It seems like there's a lot of misunderstanding as to what "demands" are. A build with a specific demand does not change what software is available on the build agent. A "demand" is simply a method of a build task expressing what requirements it has, so it can run on an agent that has the desired demands satisfied (these are the build agent's "capabilities").
This list of software is what's on the hosted build agent. If it's not there, and you can't install it via npm or the like, then you're out of luck.

Phonegap: two kinds of installations, what's the difference?

I've seen there are two kinds of installations for Phonegap, one goes through installing node.js and then phonegap and the other is done by extracting a zip file (like discussed here : How to install phonegap-2.7.0 for ios?)
What are the differences? I want to know them before choosing my way.
Basically, zip was for phonegap/cordova 2.x and CLI (based on node-npm) is for cordova/phonegap 3.x
So if you're new to phonegap/cordova you should choose the CLI installation and use cordova or phonegap version 3.5
Choosing cordova or phonegap is an other subject, but if you don't plan on using phonegap build, I'd suggest Cordova.

Resources