dotnet core on bash on ubuntu on windows 10 - Attempt #1

So, the aim is to demonstrate dotnet core on Ubuntu, but I really want to run it on Bash on Ubuntu on Windows because, firstly, I'm really impressed with the speed of the Linux System on Widows - much faster and more responsive than running a Virtual Machhine or VirtualBox with Ubuntu on it, and means I'm not wasting a Gig or Two of Ram just to run a bash shell. Makes perfect sense.

Update: if you hit an error when you run yo from bash on Ubuntu on windows 10, it's a known issue, it's on the backlog, and you can vote it up on uservoice.

Here is the plan:

  1. Install Linux Subsystem
  2. Start Bash and upgrade/update Ubuntu
  3. Install dotnet-core cli
  4. Install yeoman aspnet-generator for templating asp.net core apps
  5. Install yeoman asnet-generator-spa for templating Angular2, React and Knockout apps
  6. Build and Run some samples from Linux
  7. Publish to Git repo (GitHub and TFS Git Repo)
  8. Deploy to Azure

But it's early days for the Linux System (Beta), so I got stuck at the first hurdle: ENOMEM when tryig to install yo with the node package manager npm

Here are the steps to reproduce:


Sanity check first:

  • Make sure I'm in Developer mode. Start > Settings > Updates & Security > Developers

  • Reboot
  • Update Ubuntu
micheal@WIN10:~$ sudo apt-get update  
micheal@WIN10:~$ sudo apt-get upgrade  
micheal@WIN10:~$ sudo apt-get autoremove  
micheal@WIN10:~$ sudo npm install -g npm  
/usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js
/usr/lib
└── npm@3.10.5
micheal@WIN10:~$ sudo apt-get upgrade nodejs  
Reading package lists... Done  
Building dependency tree  
Reading state information... Done  
Calculating upgrade... Done  
nodejs is already the newest version.  
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.  
  • check versions

From Ubuntu Bash

micheal@WIN10:~$ npm --version  
3.10.5  
micheal@WIN10:~$ nodejs --version  
v4.4.7  
micheal@WIN10:~$ yo --version  
1.8.4  

I didn't spot it earlier, but npm failed to install yo correctly, so I tried to install yo again:

micheal@WIN10:~$ sudo npm install -g yo  

This fails, with the following error:

12058 error Linux 3.4.0+  
12059 error argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "yo"  
12060 error node v4.4.7  
12061 error npm  v3.10.5  
12062 error code ENOMEM  
12063 error errno ENOMEM  
12064 error syscall spawn  
12065 error spawn ENOMEM  

I've allocated 3GB to this Virtual Machine (Window 10 is running as a Guest VM on Mac OS X), and there is 600 MB availble, so it must be an issue with the Linux Subsystem memory allocation???

I've moved to the fast-ring Windows Insiders Preview, so I'll see what comes down in the next update.