发生未处理的异常:找不到模块“./browsers” -
我在堆栈上查找了其他可用问题,但找不到与此问题相关的答案。
我刚刚启动 Angular 并按照 Udemy 课程的要求安装了一些东西。创建应用程序,然后从 ngserve 开始。
当我运行 ngserve 时,出现以下错误。
运行 npm install 后,我收到以下消息。 你能指导我解决这个错误吗?
预先非常感谢您。 :)
I looked for other questions available on stack but was not able to find ans related to this issue.
I have just started Angular and installed things as asked on Udemy course. Creating app and then starting with ng serve.
While I am running ng serve, I am getting below error.
After running npm install I am getting below message.
Can you please guide me to solve this error ?
Thank you very much in advance. :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好吧,试试这个对我有用的:npm install --save-dev @angular-devkit/build-angular
well try this one it works for me:
npm install --save-dev @angular-devkit/build-angular
如果安装软件包后错误消息仍然存在,则可能是由于 NPM 设置所致。在最新版本的包管理器中,默认情况下它仅安装项目生产版本所需的包。 “build-angular”包是一个开发依赖项。如果你想让网站正常工作,你必须告诉 NPM 安装开发包,通过在“dev”版本中添加“--only”选项,所以你应该使用这个命令:
npm我--only=dev
If the error message persists after installing packages, it may be due to the NPM settings. In recent versions of the package manager, by default it only installs the packages needed for the production version of the project. The "build-angular" package is a development dependency. If you want to make the website work, you have to tell NPM to install the development packages, by adding the "--only" option with the "dev" version so you should use this command instead:
npm i --only=dev
谢谢以上各位的解答。
通过遵循以下步骤,包括避免一些错误,我能够使其发挥作用。
安装的软件包在 C 盘而不是我的应用程序文件夹中。
删除了我的旧应用程序并从头开始重新创建它。
然后当我给出“ngserve”时,它运行得很好。
Thank you for above answers.
With below steps followed including avoiding few mistakes, I was able to make it work.
Installed packages in C drive instead of my application folder.
Deleted my old app and recreated it from scratch.
And then when I gave "ng serve" it ran fine.