node_modules appears empty, you may need to run `npm install`

坚强是说给别人听的谎言 提交于 2019-12-03 12:17:23

Run npm install from the root of the project. If you're on a mac then you may want to run sudo npm install in case some of the package installations require elevated permissions. If it has submodules then leave a comment below and I'll update this answer to include how to deal with those. No use in confusing this answer with that unless you hit it.

Open the directory where your project is using cd (Project name) Then run the command npm install After then you can easily run the ng g component command

Its saying node_module is empty means its not getting path.

1st Check path.Go to that path Using cd Like 'cd C:\Windows\UrProjectName'

Then run ng serve in node command prompt.

In this situation you right click the app.component.html module then click a open in terminal.

After the terminal is opened in a bottom,you just type the command ng serve.

It can be worked properly.Each and every time you run the project in this method you avoid these types of errors.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!