node_modules显示为空,您可能需要运行`npm install`. [英] node_modules appears empty, you may need to run `npm install`
问题描述
我已经从git中克隆了一个angular 4项目.
I have cloned an angular 4 project from git.
当我转到项目的根文件夹并执行ng时.
When I go to the root folder of the project and did ng serve.
我遇到以下错误. node_modules显示为空,您可能需要运行npm install
I am getting following error. node_modules appears empty, you may need to run npm install
如何解决以上错误.
推荐答案
从项目的根目录运行npm install
.如果您使用的是Mac,则可能需要运行sudo npm install
,以防某些软件包安装需要提升的权限.如果它包含子模块,请在下面留下评论,我将更新此答案以包括如何处理这些问题.除非您按了它,否则不要将这个答案与此混淆.
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.
这篇关于node_modules显示为空,您可能需要运行`npm install`.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!