I am using Windows 10, I never had any issue using angular cli
to create and run angular project, today i noticed i was still able to run old ones using ng serve but when i tried to create new ones with ng new *name* I had these warnings at the end of the creation logs:
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\Talon\Desktop\angular\angular-essentials-two\routing\node_modules\fsevents\node_modules\rc\node_modules'
npm WARN @angular-devkit/[email protected] requires a peer of @angular-devkit/[email protected] but none is installed. You must install peer dependencies yourself.
npm WARN @schematics/[email protected] requires a peer of @angular-devkit/[email protected] but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
If I then try to go to the project and run ng serve I have
module.js:540
throw err;
^
Error: Cannot find module '@angular-devkit/core'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\Talon\Desktop\angular\angular-essentials-two\routing\node_modules\@angular-devkit\schematics\src\tree\virtual.js:10:16)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
I googled around and found this fix, but if I try to run npm install -g @angular-devkit/core I have
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\@angular-devkit\core\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ @angular-devkit/[email protected]
updated 1 package in 9.351s
And if I ng serve I have the same Cannot find module '@angular-devkit/core' error.
I don't know if it's a coincidence but before the latest Windows 10 update i had a couple of days ago everything was working fine.
My current angular cli version is 1.6.3.
npm install --save-dev @angular-devkit/core, literally just ran into this error for the first time just now and that's what fixed it for me... maybe they updated something last night?skipping optional depedencymessages at the end but if I run it, it works properly.