2

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.

3
  • Try 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? Commented Jan 20, 2018 at 17:30
  • That fixed it. It threw the same skipping optional depedency messages at the end but if I run it, it works properly. Commented Jan 20, 2018 at 17:34
  • Don't worry about the fsevents dependency, it's for iOS only I believe (both windows and linux pop this soft optional dependency warning) Commented Jan 20, 2018 at 17:44

1 Answer 1

1

npm install --save-dev @angular-devkit/core will solve this issue

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.