Nexus-compliant repository to get node and npm installers - node.js

I am looking for a nexus-compliant repository where I can get a node installer (a nexus-compliant alternative to http://nodejs.org/dist/.
Context :
In a java environment, our builds are processed by maven. Recently we add a javascript frontend app and I am trying to get it built via maven with the excellent plugin frontend-maven-plugin.
The plugin installs node and npm, then run npm install and grunt build.
Everything works perfectly.
But we MUST put all our dependencies under nexus (or some locally proxified repository).
About frontend dependencies: no problem since nexus 2.10 supports the npm registries. It works.
About the node and npm installers, they are initially downloaded from http://nodejs.org/dist/ by the plugin, and I do not know how to locally proxify this repo ... or where I can find theses installers on a nexus-compliant's one.
Any suggestions ?
Thx.

I would suggest to create a pull request/patch for the frontend plugin that allows you to add a full url for npm and node rather than just the version and the root url. Then you can host the two installed e.g. by uploading them to Nexus into a Maven 2 repository and using that URL. I filed an issue for that btw. https://github.com/eirslett/frontend-maven-plugin/issues/126
Alternatively could try to create a site repository in Nexus with the same structure and use that.

Related

npm install as a build step in TeamCity

I am studying a TeamCity project which has to do with a .NET application with Angular at the frontend. What it does not make sense to me is I cannot find anywhere npm install. For example:
The thing is in case I add a dependency in package.json which requires update of node_modules folder, everything works fine as far as the artifacts are concerned and Angular finds the files it needs!!
But how node_modules folder on TeamCity is updated?
Sorry, for being a little bit abstract; honestly, I cannot find npm install anywhere.
I would highly recommend looking at the TeamCity Node Plugin available at https://github.com/jonnyzzz/TeamCity.Node. The plugin, which is also available via the TeamCity Plugin repository for an integrated installer, will allow you to use NVM to install a specific version of Node as well as run NPM to install other dependencies, etc.
I hope this helps!

Nodejs use a project in another project

I have a beginner question concerning nodejs.
I'm working on two different nodejs projects, let's say project A and project B.
And I would like to use the functionalities of project A in B.
How can I do it??
I was thinking about using git submodules. But is there a possibility to use project A as a node_module. that means that the users only have to update it if a new version of it is available?
Thank you
No need to use git submodules - you can use npm to install a module directly from a git remote url, or directly from GitHub.
e.g.:
npm install <git remote url>
npm install githubname/reponame
See the npm install docs for details.

How to check out a JHipster project in multiple development environments

I'm evaluating JHipster; it looks great for rapid development!
Maybe a novice question: I see that the generated .gitignore ignores certain things, e.g.
/node/**
/node_modules/**
So, if I check in the generated project to a repository, and then some other developer in my team checks it out in his environment, the project would not work in his environment. Would it?
Was curious to know how to handle this. Thanks.
Since your git repo won't track node packages, others using your git repo will need install node.js, then run npm install to download all the node packages.
It's similar to them having to have java and maven installed on their environment.
Update: A developer will run 'git clone '. The source (not including node or bower) will be on their workstation. Once they've installed node.js, they'll run 'npm install' and the node directories will be created automatically for your project by downloading them from the Internet. That way you don't need to keep all your node libraries in your own git repository ...just their package name and version in the package.json file (similar to maven dependencies in pom.xml).
No one should commit the node_modules or bower_components to git, what you would do is share the project like you share the maven projects.
Write in the read me what needs to be done to get them ready, for example the installation of yo, bower, grunt or gulp and generator-jhipster.
What is very nice about liquibase, each developer can have his own version of the database, and every commit has its own database version.
What we our team does, if a developer adds something to node js package.json then we mention it in the comment: npm install needed and the same applies for bower.
That way you keep all your environments clean, and if you would like to install continuous integration like "Jenkins or Teamcity" then you make sure Jenkins is building rebuilding the whole project.

Cross-platform script to install Node + NPM + Grunt? [duplicate]

I am looking for a nexus-compliant repository where I can get a node installer (a nexus-compliant alternative to http://nodejs.org/dist/.
Context :
In a java environment, our builds are processed by maven. Recently we add a javascript frontend app and I am trying to get it built via maven with the excellent plugin frontend-maven-plugin.
The plugin installs node and npm, then run npm install and grunt build.
Everything works perfectly.
But we MUST put all our dependencies under nexus (or some locally proxified repository).
About frontend dependencies: no problem since nexus 2.10 supports the npm registries. It works.
About the node and npm installers, they are initially downloaded from http://nodejs.org/dist/ by the plugin, and I do not know how to locally proxify this repo ... or where I can find theses installers on a nexus-compliant's one.
Any suggestions ?
Thx.
I would suggest to create a pull request/patch for the frontend plugin that allows you to add a full url for npm and node rather than just the version and the root url. Then you can host the two installed e.g. by uploading them to Nexus into a Maven 2 repository and using that URL. I filed an issue for that btw. https://github.com/eirslett/frontend-maven-plugin/issues/126
Alternatively could try to create a site repository in Nexus with the same structure and use that.

meteor deploy npm packages

I use multiple npm packages in my meteor application, for instance the 'knox' package for amazon s3 access.
On my local system I don't have any problems, because I have the 'knox'- npm package installed on my system. But on the server this is obviously not the case.
I have read different suggestions what I could do:
1)
Install the npm module into the /public folder of my application
- unfortunately I don't know how to do that.
2)
I followed this tutorial:
NPM Deploy Tutorial
I created packages/knox/package.js packages/knox/knox.js and I am pretty sure I did everything as described in the tutorial but this is not even working locally
Use npm package from Atmosphere. See details on how to use it.
Did you remember to add the knox package to the .meteor/packages file?
The link you shared is pre Meteor 0.6.5, which loaded all packages in packages/ automatically. Now, you need to specify them individually.

Resources