Tuesday, March 28, 2017

Visual Studio 2017–.NET 4.6.2 is missing

After installing Visual Studio 2017, I noticed that .NET 4.6.2 was still missing from the version list. Strange! Especially because the .NET site mentions otherwise:


Luckily you can add it by installing the .NET Framework 4.6.2 Developer Pack from here

Once installed you will see .NET 4.6.2 added to the list of supported versions:


Monday, March 27, 2017

NPM–Exclude files from your package

By default NPM will include all files as part of your package. But how can you exclude certain files?

To support that scenario NPM has the concept of a .npmignore file similar to a .gitignore file(Note: in case there is no .npmignore file, but there is a .gitignore file, nom will ignore the files matched by the .gitignore file).

.npmignore files follow the same pattern rules as .gitignore files.

Additionally, everything in node_modules is ignored, except for bundled dependencies. npm automatically handles this for you, so don't bother adding node_modules to .npmignore.

The following paths and files are never ignored, so adding them to .npmignore is pointless:

  • package.json
  • README (and its variants)
  • CHANGELOG (and its variants)

Friday, March 24, 2017

Angular 4 is out!

Angular 4 is out! My first reaction was WHAT? Did I miss the release of Angular 3 somewhere? Turns out that they decided to skip a version to align with the Angular version 4 router(an announcement that I missed somehow).

The focus on this release is making Angular applications smaller and faster. I’ll start upgrading my projects this weekend.

Expect a follow-up post with my experiences soon…

PS: Here is the announcement on their blog: http://angularjs.blogspot.be/2017/03/angular-400-now-available.html

Thursday, March 23, 2017

TypeScript - TS2403 Subsequent variable declarations must have the same type. Variable 'module' must be of type 'NodeModule'

Got a TypeScript error when trying to get my Angular app up and running:

Error      TS2403  Subsequent variable declarations must have the same type.  Variable 'module' must be of type 'NodeModule', but here has type '{ id: string; }'.   TypeScript Virtual Projects               C:\projects\MyAngularClient\src\typings.d.ts               2             Active

To fix it, I had to comment out the module declaration typings.d.ts:

Wednesday, March 22, 2017

Eventsourcing - One table with 3 columns, that’s all you need to build any kind of application

If you are new to EventSourcing I can recommend the eBay Tech Talk in Berlin, Raimo Radczewski did a great introduction about EventSourcing and CQRS.

Best quote during the talk:

One table with three columns; with EventSourcing, that’s all you need to develop an e-commerce system, a CRM app, or any kind of application you can imagine.

Tuesday, March 21, 2017

NPM Package.json publishing configuration

When managing your package.json file there are 2 use cases that can impact how you configure it:

I don't want my package published at all. It's private.

To enable this set "private": true in your package.json. This will prevent it from being published at all.

If you try to accidently publish the package, you’ll get the following feedback:

C:\projects\test\npmtest>npm publish
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\BaWu\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "publish"
npm ERR! node v6.10.0
npm ERR! npm  v3.10.5

npm ERR! This package has been marked as private
npm ERR! Remove the 'private' field from the package.json to publish it.
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <

npm ERR! Please include the following file with any support request:
npm ERR!     C:\projects\test\npmtest\npm-debug.log

I only want my package to be published to an internal registry.

Add a "publishConfig":{"registry":"http://my-internal-registry.local"} section to your package.json to force it to be published only to your internal registry.

Invoking the ‘npm publish’ command will publish the package to the specified registry.

More information at http://browsenpm.org/package.json

Monday, March 20, 2017

ProGet: NPM connector returns no records

At a customer we are using ProGet as our internal package manager server. ProGet supports a lot of different package formats including NPM and NuGet. Thanks to the usage of connectors you can even link to other package sources like the official NuGet feed or the official NPM registry.

Unfortunately after creating an NPM feed and linking it to the official NPM registry(https://registry.npmjs.org) using a connector, the connector didn’t do anything and our feed remained empty.

Turns out that a scheduled task exists that indexes the Npm registry but it only runs once a week by default.

To find this scheduled task, go to your Proget site and click on the Administration icon image on the right


After logging in, go to Scheduled Tasks below System settings


In the list of Scheduled Tasks you should find the ‘FullNpmConnectorIndex’ task. You can invoke it immediatelly by clicking on the ‘Play’ button at the right.