如何运行Scala.js1.3.0教程-第2部分



在将项目移动到C上的本地文件系统后:现在我得到了

sbt:Scala.js Tutorial> run
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] Compiling 1 Scala source to C:UsersERICDocumentsgitscalajs-tutorialtargetscala-2.13classes ...
[info] Fast optimizing C:UsersERICDocumentsgitscalajs-tutorialtargetscala-2.13scala-js-tutorial-fastopt
[info] Running tutorial.webapp.TutorialApp. Hit any key to interrupt.
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module 'jsdom'
Require stack:
- C:UsersERICDocumentsgitscalajs-tutorial[stdin]
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Module.require (internal/modules/cjs/loader.js:903:19)
at require (internal/modules/cjs/helpers.js:74:18)
at codeWithJSDOMContext.js:3:15
at codeWithJSDOMContext.js:52:3
at Script.runInThisContext (vm.js:120:18)
at Object.runInThisContext (vm.js:309:38)
at [stdin]:2:29
at Script.runInThisContext (vm.js:120:18) {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'C:\Users\ERIC\Documents\git\scalajs-tutorial\[stdin]' ]
}
[error] org.scalajs.jsenv.ExternalJSRun$NonZeroExitException: exited with code 1
[error]         at org.scalajs.jsenv.ExternalJSRun$$anon$1.run(ExternalJSRun.scala:186)
[error] stack trace is suppressed; run last Compile / run for the full output
[error] (Compile / run) org.scalajs.jsenv.ExternalJSRun$NonZeroExitException: exited with code 1
[error] Total time: 6 s, completed Oct. 16, 2020, 9:53:33 a.m.

还有

sbt:Scala.js Tutorial> evicted
[warn] Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[warn]  * org.scala-js:scalajs-library_2.13:1.3.0 is selected over 1.0.0
[warn]      +- scala-js-tutorial:scala-js-tutorial_sjs1_2.13:0.1.0-SNAPSHOT (depends on 1.3.0)
[warn]      +- org.scala-js:scalajs-dom_sjs1_2.13:1.1.0           (depends on 1.0.0)
[success] Total time: 0 s, completed Oct. 16, 2020, 10:18:13 a.m.

Scala.js 1.3.0是否已在(https://github.com/scala-js/scalajs-tutorial)然而

它有点被埋没了,但从repo链接的教程提到你需要单独安装jsdom:

这将使用jsdom库来模拟Node.js中的DOM。注意,您需要使用单独安装它

$ npm install jsdom

重新加载后,您可以调用run successfully

相关内容

最新更新