0

I created a new angular 6 app, when I try to run the app using ng serve --open it gives this error. what might be causing the error and what should I do to fix this?


 Could not find API compiler-cli, function VERSION Error: Could not find API compiler-cli, function VERSION
 at _error (/home/linux/Documents/angu/my-app/node_modules/@ngtools/webpack/src/ngtools_api.js:8:11)
 at getApiMember (/home/linux/Documents/angu/my-app/node_modules/@ngtools/webpack/src/ngtools_api.js:11:32)
 at Object.<anonymous> (/home/linux/Documents/angu/my-app/node_modules/@ngtools/webpack/src/ngtools_api.js:50:19)
 at Module._compile (internal/modules/cjs/loader.js:776:30)
 at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
 at Module.load (internal/modules/cjs/loader.js:653:32)
 at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
 at Function.Module._load (internal/modules/cjs/loader.js:585:3)
 at Module.require (internal/modules/cjs/loader.js:690:17)
 at require (internal/modules/cjs/helpers.js:25:18)
 at Object.<anonymous> (/home/linux/Documents/angu/my-app/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:28:23)
 at Module._compile (internal/modules/cjs/loader.js:776:30)
 at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
 at Module.load (internal/modules/cjs/loader.js:653:32)
 at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
 at Function.Module._load (internal/modules/cjs/loader.js:585:3)
Basel Issmail
4,0457 gold badges24 silver badges37 bronze badges
asked Aug 14, 2019 at 12:09

1 Answer 1

1

Try this

Step 1: npm install -g @angular/cli@latest 
Step 2: ng new name-of-project (ignore if project already created) 
Step 3: cd name-of-project (ignore if project already created) 
Step 4: npm install @angular/cli --save-dev 
Step 5: npm install @angular/compiler-cli --save-dev 
Step 6: ng serve 
answered Aug 14, 2019 at 12:18
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.