WebStorm中的create-react-app

时间:2017-09-09 19:19:05

标签: node.js npm webstorm create-react-app

我正在尝试使用npm包" create-react-app"使用WebStorm开始一个反应项目。

我已经运行/path/to/target/streams/$global/ivySbt/$global/streams/outjava.io.IOException: No such file or directory at sbt.ErrorHandling$.translate(ErrorHandling.scala:10) at sbt.IO$.touch(IO.scala:210) at sbt.std.Streams$$anon$3$$anon$2.make(Streams.scala:129) at sbt.std.Streams$$anon$3$$anon$2.text(Streams.scala:113) at sbt.std.Streams$$anon$3$$anon$2.log(Streams.scala:124) at sbt.std.TaskStreams$class.log(Streams.scala:56) at sbt.std.Streams$$anon$3$$anon$2.log$lzycompute(Streams.scala:102) at sbt.std.Streams$$anon$3$$anon$2.log(Streams.scala:102) at sbt.Classpaths$$anonfun$ivySbt0$1.apply(Defaults.scala:1338) at sbt.Classpaths$$anonfun$ivySbt0$1.apply(Defaults.scala:1337) at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:35) at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:34) 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:748) Caused by: java.io.IOException: No such file or directory at java.io.UnixFileSystem.createFileExclusively(Native Method) at java.io.File.createNewFile(File.java:1012) at sbt.IO$$anonfun$1.apply$mcZ$sp(IO.scala:210) at sbt.IO$$anonfun$1.apply(IO.scala:210) at sbt.IO$$anonfun$1.apply(IO.scala:210) at sbt.ErrorHandling$.translate(ErrorHandling.scala:10) at sbt.IO$.touch(IO.scala:210) at sbt.std.Streams$$anon$3$$anon$2.make(Streams.scala:129) at sbt.std.Streams$$anon$3$$anon$2.text(Streams.scala:113) at sbt.std.Streams$$anon$3$$anon$2.log(Streams.scala:124) at sbt.std.TaskStreams$class.log(Streams.scala:56) at sbt.std.Streams$$anon$3$$anon$2.log$lzycompute(Streams.scala:102) at sbt.std.Streams$$anon$3$$anon$2.log(Streams.scala:102) at sbt.Classpaths$$anonfun$ivySbt0$1.apply(Defaults.scala:1338) at sbt.Classpaths$$anonfun$ivySbt0$1.apply(Defaults.scala:1337) at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:35) at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:34) 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:748) 来全局安装软件包,并且可以从命令行完全使用该软件包(即npm install -g create-react-app)。

但是,在WebStorm中创建项目并使用全局&#34; create-react-app&#34;包(使用create-react-app <proj name>找到),我遇到了这个错误:

npm list -g

我在某个时候出错了吗?

1 个答案:

答案 0 :(得分:2)

事实证明我有节点版本4,而create-react-app需要版本&gt; = 6 - 尽管此警告未通过WebStorm显示&#34;运行&#34;面板。

因此,我通过使用nvm更新到节点v6.11.3来修复此问题。