I have GitLab installed on an internal development server. I would like to use it as a distribution endpoint for jspm during development. It is possible to define which git server you use in JSPM or is there some other way to use packages from a private source?
Have a look at https://github.com/Orbs/jspm-git – "A generic jspm registry for Git Repositories."
Related
We have a code pipeline hosted on AWS. In the CodeDeploy stage, it installs the packages in our nodejs project. Now one of these packages is a private package hosted on Github on a Pro user account. I have setup the integration with Github. The source was Github version 1, but sinceit wasn't recomended, I changed it to Github version 2, with a proper connection. Now there's an AWS app installed on our repo to manage access. I configured it to allow access to both the nodejs repo and the private package repo. But We're still getting 404 not found when the pipeline runs.
So basically I did two things to solve my problem:
1- Move the library from dev dependencies to dependencies in package.json, since our pipeline only installs production packages.
2- Copy over the .npmrc file from home folder to the repo. This way the pipeline knows it has to download from the github registry and not from the npm registry.
Hope this saves somebody's time in the future.
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.
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.
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.
What is the recommended way of distributing packages to Node.js servers, running inside a company intranet? The problem is most servers cannot directly access the npm registry. Is it possible to install a private repo, sync it with the official one, and then sync the internal servers from here?
Best practice is to check your node_modules into your git repository (remove node_modules from .gitignore). Then, only your developer machines will need access to npm.org, and the servers will get the packages from your internal git repository.