简体   繁体   中英

Error: Cannot find module '@angular/compiler'

I downloaded an angular template and when running "ng serve" I receive:

Cannot find module '@angular/compiler' Error: Cannot find module '@angular/compiler' ...

Then I tried everything that came up on google, including looking at the dependencies and reinstalling everything.

Then on uninstalling npm using this command:

sudo npm uninstall angular-cli

I get:

Unhandled rejection Error: Command failed: /usr/bin/git clone --depth=1 -q -b fix-drag-issue git://github.com/swimlane/dragula.git /Users/angellolazar/.npm/_cacache/tmp/git-clone-c0a842b4 /Users/angellolazar/.npm/_cacache/tmp/git-clone-c0a842b4/.git: Permission denied

 at ChildProcess.exithandler (child_process.js:294:12) at ChildProcess.emit (events.js:189:13) at maybeClose (internal/child_process.js:970:16) at Socket.stream.socket.on (internal/child_process.js:389:11) at Socket.emit (events.js:189:13) at Pipe._handle.close (net.js:600:12) 

⸨ ░░░░░░⸩ ⠹ extract:npm: sill extract strip-ansi@3.0.1

Now, when looking at my version of Angular, I receive:

Angular: ... animations, cdk, common, compiler, core, forms, http ... language-service, platform-browser, platform-browser-dynamic ... router

It's a mess... Please let me know what other information you may need to get this resolved.

I think by uninstalling everything, they mean to remove your node_modules folder and just install all your dependencies again. So just delete your node_modules folder and do an npm install .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM