Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ng serve build error after npm install

I'm getting the following error in my angular2 app with cmd ng serve after deleting the node_modules directory and building it new with npm install.

Error: Cannot find module 'common-tags'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/angular-cli/models/config.js:8:21)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)

also npm install common-tags to add it manually does not work

like image 284
edamerau Avatar asked Oct 04 '16 13:10

edamerau


1 Answers

Looks like you should update your angular-cli and clean the cache

npm uninstall -g @angular/cli
npm cache clean --force 
npm install -g @angular/cli@latest
npm install
like image 191
Abner Tellez Sazo Avatar answered Oct 10 '22 13:10

Abner Tellez Sazo