繁体   English   中英

错误:找不到模块“ @ angular / compiler”

[英]Error: Cannot find module '@angular/compiler'

我下载了一个角度模板,运行“ ng serve”时收到:

找不到模块'@ angular / compiler'错误:找不到模块'@ angular / compiler'...

然后,我尝试了Google上出现的所有内容,包括查看依赖项并重新安装了所有内容。

然后使用以下命令卸载npm:

sudo npm uninstall angular-cli

我得到:

未处理的拒绝错误:命令失败:/ 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:权限被拒绝

 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) 

⠹提取物:npm:窗台提取物strip-ansi@3.0.1

现在,在查看我的Angular版本时,我收到:

角度:...动画,cdk,通用,编译器,核心,表格,http ...语言服务,平台浏览器,平台浏览器动态...路由器

一团糟...请让我知道您可能需要其他什么信息才能解决此问题。

我认为通过卸载所有内容,它们意味着删除您的node_modules文件夹,然后再次安装所有依赖项。 因此,只需删除您的node_modules文件夹并执行npm install

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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