create-react-app git推送node_modules [英] create-react-app git pushing node_modules

查看:337
本文介绍了create-react-app git推送node_modules的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我试图从本地git构建中使用 create-react-app 来推送我的初始提交。我的 .gitignore 看起来像这样:

 #请参阅https:// help.github.com/ignore-files/了解有关忽略文件的更多信息。 

#依赖项
/ node_modules

#测试
/ coverage

#制作


#misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log *
yarn-debug.log *
yarn-error.log *

我的目录如下所示:





默认情况下,目录结构保持不变,为什么上传 node_modules

更新信息:

修改后,在我的git中忽略,但似乎仍然推动` node_modules'。我的git root是theapp> build / node_modules / public / etc ......如果有帮助的话。



我继续并允许它,但是在我 git push azure master ,我现在得到了这个:



另外,在Windows中,我的文件浏览器如下所示:





进一步的想法?

解决方案

/ node_modules 正在查看您的计算机的根目录。

你想要的是 node_modules / 。它会查找与您当前位置相关的目录。


So I am trying to push my initial commit using the create-react-app from a local git build. My .gitignore looks like such:

# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules

# testing
/coverage

# production


# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

And my directory looks like this:

Left the directory structure the same by default, so why is it uploaded node_modules as well?

UPDATED INFO:

So revised that in my git ignore, but it seemed to have still pushed the `node_modules'. My git root is theapp > build / node_modules / public / etc... if that helps.

I went ahead and allowed it, but at the end of my push with git push azure master, I got this now:

Additionally, within windows, my file explorer looks like this:

Further thoughts?

解决方案

/node_modules is looking at the root of your computer.

What you want is node_modules/. Which looks for that directory relative to your current position.

这篇关于create-react-app git推送node_modules的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆