I am using Angular CLI version 7.3.9 because I can't upgrade to 8.3.2 (I'm assuming the error I get from trying to upgrade Angular CLI is the same issue). When I try to create a new project I'm getting an NPM exception. I've tried clearing the npm cache and updating all of the globally installed packages. Some packages error out with similar errors, other seem to work fine.
This is only affecting one machine. I've tried uninstalling and reinstalling @angular/cli, uninstalling and reinstalling node, and trying both node 10 and 12. None have solved the error.
What are my options as far as troubleshooting NPM install errors? What can I try to fix this issue below? Is there anywhere I should look for better answers?
When I run ng version
I get the following output:
Angular CLI: 7.3.9
Node: 10.16.3
OS: win32 x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.13.9
@angular-devkit/core 7.3.9
@angular-devkit/schematics 7.3.9
@schematics/angular 7.3.9
@schematics/update 0.13.9
rxjs 6.3.3
typescript 3.2.4
When I run the command ng new TestProject
I get the following output:
PS L:\Repos\Temp> ng new TestProject
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? Less [ http://lesscss.org
]
CREATE TestProject/angular.json (3940 bytes)
CREATE TestProject/package.json (1311 bytes)
CREATE TestProject/README.md (1028 bytes)
CREATE TestProject/tsconfig.json (435 bytes)
CREATE TestProject/tslint.json (1621 bytes)
CREATE TestProject/.editorconfig (246 bytes)
CREATE TestProject/.gitignore (629 bytes)
CREATE TestProject/src/favicon.ico (5430 bytes)
CREATE TestProject/src/index.html (298 bytes)
CREATE TestProject/src/main.ts (372 bytes)
CREATE TestProject/src/polyfills.ts (2841 bytes)
CREATE TestProject/src/styles.less (80 bytes)
CREATE TestProject/src/test.ts (642 bytes)
CREATE TestProject/src/browserslist (388 bytes)
CREATE TestProject/src/karma.conf.js (1024 bytes)
CREATE TestProject/src/tsconfig.app.json (166 bytes)
CREATE TestProject/src/tsconfig.spec.json (256 bytes)
CREATE TestProject/src/tslint.json (244 bytes)
CREATE TestProject/src/assets/.gitkeep (0 bytes)
CREATE TestProject/src/environments/environment.prod.ts (51 bytes)
CREATE TestProject/src/environments/environment.ts (662 bytes)
CREATE TestProject/src/app/app-routing.module.ts (245 bytes)
CREATE TestProject/src/app/app.module.ts (393 bytes)
CREATE TestProject/src/app/app.component.html (1152 bytes)
CREATE TestProject/src/app/app.component.spec.ts (1110 bytes)
CREATE TestProject/src/app/app.component.ts (216 bytes)
CREATE TestProject/src/app/app.component.less (0 bytes)
CREATE TestProject/e2e/protractor.conf.js (752 bytes)
CREATE TestProject/e2e/tsconfig.e2e.json (213 bytes)
CREATE TestProject/e2e/src/app.e2e-spec.ts (640 bytes)
CREATE TestProject/e2e/src/app.po.ts (251 bytes)
> node-sass@4.12.0 install L:\Repos\Temp\TestProject\node_modules\node-sass
> node scripts/install.js
> core-js@2.6.9 postinstall L:\Repos\Temp\TestProject\node_modules\core-js
> node scripts/postinstall || echo "ignore"
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.12.0 (node_modules\node-sass):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.12.0 install: `node scripts/install.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn bash ENOENT
npm ERR! file bash
npm ERR! path bash
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn bash
npm ERR! core-js@2.6.9 postinstall: `node scripts/postinstall || echo "ignore"`
npm ERR! spawn bash ENOENT
npm ERR!
npm ERR! Failed at the core-js@2.6.9 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\<USER>\AppData\Roaming\npm-cache\_logs\2019-08-30T19_06_06_818Z-debug.log
Package install failed, see above.
The contents of the log above can be found here: https://gist.github.com/joecoolish/ff0ffdb7eb583ef5b18146ca2e456c2c