1

I am installing angular first time. I am using windows 7. node -v is v8.10.0 and npm -v is 5.7.1 When I run command to install angular cli.

 npm install -g @angular/cli

I get this error. What causes this error and how I can install angular on windows. I am not familiar with npm and angular

\Users\username>npm install -g @angular/cli
\Users\username\ng -> C:\Users\username\node_modules\@angular\cli\bin\ng

node-sass@4.7.2 install C:\Users\username\node_modules\@angular\cli\node_modules\node-sass
node scripts/install.js


uglifyjs-webpack-plugin@0.4.6 postinstall C:\Users\username\node_modules\@angular\cli\node_modules\webpack\node_modules\uglifyjs-webpack-plugin
node lib/post_install.js

m WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\@angular\cli\node_modules\fsevents):
m WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
m WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.7.2 (node_modules\@angular\cli\node_modules\node-sass):
m WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.7.2 install: `node scripts/install.js`
m WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn bash ENOENT

m ERR! file bash
m ERR! path bash
m ERR! code ELIFECYCLE
m ERR! errno ENOENT
m ERR! syscall spawn bash
m ERR! uglifyjs-webpack-plugin@0.4.6 postinstall: `node lib/post_install.js`
m ERR! spawn bash ENOENT
m ERR!
m ERR! Failed at the uglifyjs-webpack-plugin@0.4.6 postinstall script.
m ERR! This is probably not a problem with npm. There is likely additional logging output above.

m ERR! A complete log of this run can be found in:
m ERR!     C:\Users\username\AppData\Roaming\npm-cache\_logs\2018-03-09T15_29_18_155Z-debug.log
Vikas
  • 11,859
  • 7
  • 45
  • 69
hrishi
  • 1,610
  • 6
  • 26
  • 43

2 Answers2

0

Try this command . this may work

  npm rebuild pck-name 
for ex-
    npm rebuild node-sass
Komalpreet Singh
  • 165
  • 1
  • 10
0

You should update your npm version and try after that.

From this answer: How can I update npm on Windows?
On Windows:
Run PowerShell as Administrator

Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
npm install -g npm-windows-upgrade
npm-windows-upgrade

or it that doesn't work, simply Download and run latest MSI. Be sure to download installer for the right architecture.

After that, run npm install -g @angular/cli

If you are using Linux, you can update npm simply by running npm install -g npm

Tomislav Brabec
  • 529
  • 2
  • 14
  • 20