edamerau
edamerau

Reputation: 481

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

Upvotes: 8

Views: 6923

Answers (1)

Abner Tellez Sazo
Abner Tellez Sazo

Reputation: 64

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

Upvotes: 4

Related Questions