git - create-react-app git 推送 node_modules

标签 git reactjs azure gitignore create-react-app

因此,我尝试使用本地 git 构建中的 create-react-app 推送我的初始提交。我的 .gitignore 看起来像这样:

# 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*

我的目录如下所示:

enter image description here

默认目录结构不变,为什么还要上传node_modules

更新信息:

所以在我的 gitignore 中修改了它,但它似乎仍然推送了“node_modules”。我的 git 根目录是 theapp > build/node_modules/public/etc...如果有帮助的话。

我继续并允许它,但在使用 git push azure master 推送结束时,我现在得到了这个:

enter image description here

此外,在 Windows 中,我的文件资源管理器如下所示:

enter image description here

还有什么想法吗?

最佳答案

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

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

关于git - create-react-app git 推送 node_modules,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48468847/

相关文章:

Git 和 Mac OS X 上的变音问题

javascript - 我可以在 React 应用程序中使用什么作为 Angular 的 $http.get 的等价物

azure - 如何在service-node-port-range默认范围之外的NodePort上启动kubernetes服务?

git - 如果 github 上某个存储库的所有者停止了某个项目的工作,但我想为它做贡献怎么办?

git - 强制所有行尾到LF的git

Git rebase 在每次提交之前停止,然后编辑和 rebase --continue

reactjs - 此警告的可能原因和解决方案

reactjs - 我什么时候应该使用 MobX observable 而不是 React 状态变量?

authentication - 带有 OATH token 的 Azure MFA

sql-server - 是否可以通过 Azure 云托管上的 SQL Server Management Studio 创建 .bak 文件?