ASP.NET 5 Beta 4 “The 'prepack' script failed with status code 99”

I’ve started getting to grips with the new ASP.NET 5 project system and during the course of this process I came across a compilation error “The 'prepack' script failed with status code 99”. It was a pretty easy fix which I’ve detailed below.

The entire error I was handed back by the compilation system was as follows:

1>------ Build started: Project: ExampleProject, Configuration: Debug Any CPU ------
1>  C:\Users\exampleUser\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta4\bin\dnx.exe --appbase "C:\Users\exampleUser\Documents\GitHub\ExampleProject\src\ExampleProject" "C:\Users\exampleUser\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta4\bin\lib\Microsoft.Framework.PackageManager\Microsoft.Framework.PackageManager.dll" pack "C:\Users\exampleUser\Documents\GitHub\ExampleProject\src\ExampleProject" --configuration Debug --out "..\..\artifacts\bin\ExampleProject"
1>  grunt-cli: The grunt command line interface. (v0.1.13)
1>  The 'prepack' script failed with status code 99.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

The fix is pretty simple. It just means that the grunt-cli package is not installed in your project. You just need to initiate a package restore to get it back on its feet.

If you’re a command line person then you can type this in your project folder:

npm install

Most of the time though its a lot simpler to stay in the safe nest of Visual Studio and you can initiate a package restore by following these steps:

  1. Go to the Solution Explorer window
  2. Look in the src folder then in the name of your project then in Dependencies then find NPM
  3. Right click on the NPM node and choose Restore Packages
  4. Wait patiently while it sorts out its packages.

If you’re bored while waiting or just curious to see what its up to you can watch the progress by taking these steps:

  1. Select Output window (either docked somewhere at the bottom of your screen or in View > Output or pressing CTRL-ALT-O
  2. In the drop down at the top labelled Show output from: select Package Manager Log

When its finished it will notify you by updating the status bar at the bottom with “Installing packages complete”. You should now be one-step closer to your working project!

No comments :