Using a package.json variable in npm script
<p>I'm using npm run to build a javascript file through browserify. Before building, I would like it to create a directory in my build folder, named after the version listed in the package.json. Here is a trimmed example of my package.json:</p>

<pre><code>{
  "name": "My App",
  "version": "0.0.0-pre-alpha",
  "description": "App desc",
  "main": "index.js",
  "dependencies": {
    "browserify" : "*",
  }
  "scripts": {
    "prebuild": "mkdir -p build/$npm_package_version",
    "browserify" : "browserify ./src/index.js ./build/$npm_package_version/js/myapp-$npm_package_version.js",
    "build" : "npm run prebuild &amp;&amp; npm run browserify"
  }
}
</code></pre>

<p>The code executed in prebuild is:</p>

<pre><code>mkdir -p build/$npm_package_version
</code></pre>

<p>But I want it to execute</p>

<pre><code>mkdir -p build/0.0.0-pre-alpha
</code></pre>

<p>What am I doing wrong?</p>