“服务器在端口 9876 上启动失败:错误:EACCES:权限被拒绝”在“测试”中角度单元测试
在监视模式下运行单元测试时,Chrome 突然退出,我现在无法再运行“ng test”。这种情况是随机发生的,并且在一年多的测试工作中从未发生过。
我收到的错误是:
Server start failed on port 9876: Error: EACCES: permission denied
我在 Mac 上运行,并尝试多次重新启动 VSCode 和我的笔记本电脑。我在互联网上几乎找不到描述我的问题的文档。
我的问题:为什么我会收到此错误以及如何修复它?否则,我如何通过查看端口使用情况来找到有关此问题的更多信息,以及如何对它们进行休息或类似操作。
提前致谢!
Whilst running my Unit Tests in watch mode, Chrome suddenly quit and I now can no longer run 'ng test'. This randomly occurred, and has not happened in over a year of working on these tests.
The error I am getting is:
Server start failed on port 9876: Error: EACCES: permission denied
I am running on a Mac, and have tried restarting both VSCode and my laptop multiple times. There is little to no documentation that I could find on the internet that describes my issue.
My question: Why am I getting this error and how do I fix it? Otherwise, how can I go about finding out more information about this issue by looking at the port usages and how I could go about resting them or similar.
Thanks in Advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能需要卸载节点模块并重新安装它们才能解决问题。
请尝试像这样在超级用户模式(root 用户)下执行
您可能还需要使用以下命令重新安装:
使用此命令在监视模式下运行单元测试
May be you need to uninstall node modules and reinstall them to fix the issue.
Please try to execute in super user mode(root user) like this
You may also need to re-install using:
Use this command to run Unit Tests in watch mode
通过使用以下命令删除 ./node_modules 来修复此问题:
sudo rm -r node_modules
,然后使用以下命令重新安装:
npm install
This was fixed by removing ./node_modules using:
sudo rm -r node_modules
and then re-installed using:
npm install