git add。添加node_modules时命令无响应

时间:2017-10-12 07:58:46

标签: node.js git webpack

我跑了

2017-10-11 16:35:27.661  WARN 5 --- [           main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webSecurityConfig': Unsatisfied dependency expressed through field 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationManager' defined in class path resource [org/springframework/boot/autoconfigure/security/AuthenticationManagerConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.authentication.AuthenticationManager]: Factory method 'authenticationManager' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'OAuth2Config': Unsatisfied dependency expressed through field 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'authenticationManager': Requested bean is currently in creation: Is there an unresolvable circular reference?
2017-10-11 16:35:27.663  INFO 5 --- [           main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2017-10-11 16:35:27.676  INFO 5 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2017-10-11 16:35:27.718  INFO 5 --- [           main] utoConfigurationReportLoggingInitializer :

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-10-11 16:35:27.730 ERROR 5 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

The dependencies of some of the beans in the application context form a cycle:

   webSecurityConfig (field private org.springframework.security.authentication.AuthenticationManager com.project.auth.config.WebSecurityConfig.authenticationManager)
┌─────┐
|  authenticationManager defined in class path resource [org/springframework/boot/autoconfigure/security/AuthenticationManagerConfiguration.class]
↑     ↓
|  OAuth2Config (field private org.springframework.security.authentication.AuthenticationManager com.project.auth.config.OAuth2Config.authenticationManager)
└─────┘

然后,根目录中有一个package.json和一个node_modules目录。 我想将node_modules目录添加到git repo中。 我跑完后

git init
npm install --save-dev webpack

没有任何回应。我发现git.exe进程占用的内存越来越多,但几个小时后没有任何响应。 这有什么问题? 它是由git添加到repo中的大量文件引起的吗? 如何在执行该命令时调试详细信息? 如果我只是git add . 其他一些不是node_modules的文件/文件夹,那么一切正常。 enter image description here

2 个答案:

答案 0 :(得分:1)

你有git init repo文件夹吗?如果是,那么您可以运行git status。在那里你应该看到任何新的或改变的文件夹。

如果未提及node_modules,我猜您项目文件夹中有.gitignore个文件。如果您想git add节点模块文件夹,则需要从node_modules/删除.gitignore

npm install --save-dev webpack将在package.json中再添加一个依赖项,并在您的节点本地存储库中安装webpack。这不是一个与git相关的命令。

还请检查此问题:Git - Ignore node_modules folder everywhere

跳跃这将有所帮助,

答案 1 :(得分:1)

我想通了自己。 这是由node_modules目录中的几个符号链接引起的。如果我将git-bash评估为管理员,则可以将新安装的node_module符号链接创建为linux。然后当git add运行良好。也许,如果没有评估git-bash,git-bash就无法创建符号链接,导致几乎所有文件都需要添加git,更糟糕的是可能是symblink和节点模块人员之间的循环引用(不确定),导致git的内存消耗总是增加,没有反应。 希望如果在Windows上遇到同样的问题,它可以帮助其他人。