Newbie Trouble with JSDOM


#1

Dear all,

When I try run on the step 6 of the Basic ScalaJS tutorial here:

I get the error in the P.S. (contrary to what the tutorial promises before “Adding uTest”). Does anyone know what’s going wrong? How do I fix that?

TIA,
–Hossein

P.S.

> last compile:run
[info] Running tutorial.webapp.TutorialApp
[debug] with JSEnv ExternalJSEnv for Node.js with JSDOM
[debug] Starting process: node
[error] module.js:471
[error] throw err;
[error] ^
[error]
[error] Error: Cannot find module ‘jsdom’
[error] at Function.Module._resolveFilename (module.js:469:15)
[error] at Function.Module._load (module.js:417:25)
[error] at Module.require (module.js:497:17)
[error] at require (internal/module.js:20:19)
[error] at [stdin]:39:13
[error] at [stdin]:67:3
[error] at ContextifyScript.Script.runInThisContext (vm.js:25:33)
[error] at Object.runInThisContext (vm.js:97:38)
[error] at Object. ([stdin]-wrapper:6:22)
[error] at Module._compile (module.js:570:32)
org.scalajs.jsenv.ExternalJSEnv$NonZeroExitException: Node.js with JSDOM exited with code 1
at org.scalajs.jsenv.ExternalJSEnv$AbstractExtRunner.waitForVM(ExternalJSEnv.scala:119)
at org.scalajs.jsenv.ExternalJSEnv$ExtRunner.run(ExternalJSEnv.scala:168)
at org.scalajs.sbtplugin.ScalaJSPluginInternal$.org$scalajs$sbtplugin$ScalaJSPluginInternal$$jsRun(ScalaJSPluginInternal.scala:718)
at org.scalajs.sbtplugin.ScalaJSPluginInternal$$anonfun$73$$anonfun$apply$50$$anonfun$apply$51.apply(ScalaJSPluginInternal.scala:860)
at org.scalajs.sbtplugin.ScalaJSPluginInternal$$anonfun$73$$anonfun$apply$50$$anonfun$apply$51.apply(ScalaJSPluginInternal.scala:854)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[error] (compile:run) org.scalajs.jsenv.ExternalJSEnv$NonZeroExitException: Node.js with JSDOM exited with code 1


#2

I had the same problem

npm install jsdom --save

helped