Getting errors when trying to install Angular-cli tool
<p>As advised I ran "npm install -g angular-cli" to install the CLI tool.</p>

<p>I have installed windows tools using "npm install --global --production windows-build-tools" and also "npm install -g node-gyp" both via powershell running as administrator.</p>

<p>I still cant get this to work... I know Python 2.7 is installed and gyp as I have installed other projects but this one fails.</p>

<p>The error is as follows:</p>

<pre><code>    PS C:\WINDOWS\system32&gt; npm install -g angular-cli
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases &gt;= v7.0. Please update t
o graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated lodash-node@2.4.1: This package is discontinued. Use lodash@^4.0.0.
npm WARN deprecated lodash.assign@4.2.0: This package is deprecated. Use Object.assign.
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
C:\Users\simon\AppData\Roaming\npm\ng -&gt; C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\bin\ng

&gt; node-zopfli@1.4.0 install C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-zopfli
&gt; node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download: https://node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v48-win32-x64.tar.g
z
node-pre-gyp ERR! Pre-built binaries not found for node-zopfli@1.4.0 and node@6.6.0 (node-v48 ABI) (falling back to sour
ce compile with node-gyp)
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error
 MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK vers
ion in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\simon\
AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-zopfli\build\zopfli.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node
-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\simon\\AppData\\Roaming\\npm\\node_modules\\angular-c
li\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\Users\\simon\\AppData\\Roaming
\\npm\\node_modules\\angular-cli\\node_modules\\node-zopfli\\lib\\binding\\node-v48-win32-x64\\zopfli.node" "--module_na
me=zopfli" "--module_path=C:\\Users\\simon\\AppData\\Roaming\\npm\\node_modules\\angular-cli\\node_modules\\node-zopfli\
\lib\\binding\\node-v48-win32-x64"
gyp ERR! cwd C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-zopfli
gyp ERR! node -v v6.6.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\simon\AppData\Roaming\npm\no
de_modules\angular-cli\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\simon\AppData\R
oaming\npm\node_modules\angular-cli\node_modules\node-zopfli\lib\binding\node-v48-win32-x64\zopfli.node --module_name=zo
pfli --module_path=C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-zopfli\lib\binding\node
-v48-win32-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.&lt;anonymous&gt; (C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\nod
e_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:877:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Windows_NT 10.0.14393
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\simon\\AppData\\Roaming\\npm\\node_modules\\
angular-cli\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-zopfli
node-pre-gyp ERR! node -v v6.6.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.30
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\node_mod
ules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\simon\AppData\Roaming\npm\node_modules\angular
-cli\node_modules\node-zopfli\lib\binding\node-v48-win32-x64\zopfli.node --module_name=zopfli --module_path=C:\Users\sim
on\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-zopfli\lib\binding\node-v48-win32-x64' (1)
npm WARN install:node-zopfli@1.4.0 node-zopfli@1.4.0 install: `node-pre-gyp install --fallback-to-build`
npm WARN install:node-zopfli@1.4.0 Exit status 1
C:\Users\simon\AppData\Roaming\npm
`-- angular-cli@1.0.0-beta.15

npm WARN optional Skipping failed optional dependency /angular-cli/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14
</code></pre>

<p>I note that fsevents has failed (npm WARN at the bottom)... but its saying its an optional dependency.</p>

<p>I have visited other questions where I have unistalled cli/cleared the cache and then reistalled latest... </p>

<p>After doing this and then restarting the PC I tried first ng --help and got:</p>

<pre><code>    C:\Users\simon\SPA\CLI-MASTER\Test&gt;ng --help
fs.js:640
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

TypeError: path must be a string or Buffer
    at TypeError (native)
    at Object.fs.openSync (fs.js:640:18)
    at Object.fs.readFileSync (fs.js:508:33)
    at Function.Version.fromProject (C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\upgrade\version.js:87:31)
    at Function.Version.isPreWebpack (C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\upgrade\version.js:111:31)
    at Function.Version.assertPostWebpackVersion (C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\upgrade\version.js:97:18)
    at C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\bin\ng:25:15
    at C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\node_modules\resolve\lib\async.js:44:21
    at ondir (C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\node_modules\resolve\lib\async.js:187:31)
    at C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\node_modules\resolve\lib\async.js:153:39
</code></pre>

<p>Not what I was hoping for...</p>

<p>How do I fix this problem and get the CLI tool to work?</p>