gpt4 book ai didi

java - 在 Windows 7 中运行 Play 应用程序时为 "RuntimeException: Problems with NPM resolution"

转载 作者:行者123 更新时间:2023-11-30 10:13:30 26 4
gpt4 key购买 nike

在我的 Play Framework 应用程序目录中键入命令 sbt clean compilesbt clean run 时,出现以下错误。该项目在 Ubuntu 环境中运行良好。但是,在 Windows 7 环境中它似乎无法运行。我曾尝试在线搜索但没有得到任何帮助。我在 https://github.com/sbt/sbt-less/issues/68 尝试了解决方案,我删除了项目/目标和项目/项目,但这并没有解决它。请帮忙

意外异常

RuntimeException: Problems with NPM resolution. Aborting build. No source available

这里是异常堆栈跟踪:

java.lang.RuntimeException: Problems with NPM resolution. Aborting build.
scala.sys.package$.error(package.scala:27)
com.typesafe.sbt.jse.SbtJsEngine$$anonfun$2$$anonfun$3.apply(SbtJsEngine.scala:114)
com.typesafe.sbt.jse.SbtJsEngine$$anonfun$2$$anonfun$3.apply(SbtJsEngine.scala:91)
sbt.FileFunction$$anonfun$cached$1.apply(Tracked.scala:253)
sbt.FileFunction$$anonfun$cached$1.apply(Tracked.scala:253)
sbt.FileFunction$$anonfun$cached$2$$anonfun$apply$3$$anonfun$apply$4.apply(Tracked.scala:267)
sbt.FileFunction$$anonfun$cached$2$$anonfun$apply$3$$anonfun$apply$4.apply(Tracked.scala:263)
sbt.Difference.apply(Tracked.scala:224)
sbt.Difference.apply(Tracked.scala:206)
sbt.FileFunction$$anonfun$cached$2$$anonfun$apply$3.apply(Tracked.scala:263)
sbt.FileFunction$$anonfun$cached$2$$anonfun$apply$3.apply(Tracked.scala:262)
sbt.Difference.apply(Tracked.scala:224)
sbt.Difference.apply(Tracked.scala:200)
sbt.FileFunction$$anonfun$cached$2.apply(Tracked.scala:262)
sbt.FileFunction$$anonfun$cached$2.apply(Tracked.scala:260)
com.typesafe.sbt.jse.SbtJsEngine$$anonfun$2.apply(SbtJsEngine.scala:122)
com.typesafe.sbt.jse.SbtJsEngine$$anonfun$2.apply(SbtJsEngine.scala:86)
scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
sbt.std.Transform$$anon$4.work(System.scala:63)
sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
sbt.Execute.work(Execute.scala:237)
sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)

最佳答案

JsEngine npmNodeModules 步骤造成了问题。 Google groups post提供了以下解决方案以在构建期间禁用此步骤:在 build.sbt 中将 JsEngineKeys 设置为 Nil 如下所示解决了问题:

lazy val root = (project in file("."))
.enablePlugins(PlayScala, BuildInfoPlugin)
.settings(
// Disable NPM node modules
JsEngineKeys.npmNodeModules in Assets := Nil,
JsEngineKeys.npmNodeModules in TestAssets := Nil
)

关于java - 在 Windows 7 中运行 Play 应用程序时为 "RuntimeException: Problems with NPM resolution",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51300631/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com