Configure Sinopia npm Repository Server to Cache Scoped Packages

If you are working with Node.js Package Manager (npm), you will usually retrieve npm packages from the official registry of npm (https://registry.npmjs.org) and publish own packages there. But in some cases, you might want to keep packages private, such as internal components. For this purpose, you could either go with npm which offers paid plans and on-premises installations of the package registry or you could alternatively decide to run a custom repository server. Sinopia is such a private npm repository server, which in addition acts as a proxy for the official npm package registry and caches downloaded packages. This saves bandwidth and continues to work if the internet connection or the original package registry is down.

npm has a concept of scoped packages, where similar or related packages are grouped together. Angular 2 utilizes this concept in its packages named like @angular/core, with angular being the scope and core being the package name. But if you try to install a scoped package via Sinopia, the installation fails. In the Sinopia logs, you will see an error message similar to:

http <-- 404, user: undefined, req: 'GET /@angular%2fcompiler', error: no such package available

Here’s how to fix this.

Continue reading Configure Sinopia npm Repository Server to Cache Scoped Packages

Angular 2 Dependencies: Features from the Future

Angular 2 is the next version of Google’s popular SPA framework. If you’re not yet familiar with it, you can find an overview here. In this article, I will focus on the dependencies of Angular 2. Whereas AngularJS (1.x) could either be run stand-alone or on top of jQuery, Angular 2 requires some third-party dependencies, which we’ll take a look at in this article:

  1. Node.js and npm
  2. ES6 Shim
  3. ES6 Promise
  4. Metadata Reflection API
  5. zone.js
  6. RxJS

Continue reading Angular 2 Dependencies: Features from the Future