0

我想用试剂和无花果开始一个项目,我以前用那个命令做过,它已经奏效了,事实上它们仍然有效。但是有了一个新的依赖项的一些配置和版本发生了变化,它不再以“lein fighwheel”开头。这是我的 project.clj

(defproject ajedrez1 "0.1.0-SNAPSHOT"
  :description "FIXME: write this!"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}

  :min-lein-version "2.9.1"

  :dependencies [[org.clojure/clojure "1.10.0"]
                 [org.clojure/clojurescript "1.10.773"]
                 [org.clojure/core.async  "0.4.500"]
                 [reagent "0.10.0" :exclusions [cljsjs/react cljsjs/react-dom cljsjs/react-dom-server]]]

  :plugins [[lein-figwheel "0.5.20"]
            [lein-cljsbuild "1.1.7" :exclusions [[org.clojure/clojure]]]]

  :source-paths ["src"]

  :cljsbuild {:builds
              [{:id "dev"
                :source-paths ["src"]

                :figwheel {:on-jsload "ajedrez1.core/on-js-reload"
                           :open-urls ["http://localhost:3449/index.html"]}

                :compiler {:main ajedrez1.core
                           :target :bundle
                           :asset-path "js/compiled/out"
                           :output-to "resources/public/js/compiled/out/index.js"
                           :output-dir "resources/public/js/compiled/out"
                           :bundle-cmd {:none ["npx.cmd" "webpack" "--mode=development"]
                                        :default ["npx.cmd" "webpack"]}
                           :source-map-timestamp true
                           
                           :preloads [devtools.preload]}}
              
               {:id "min"
                :source-paths ["src"]
                :compiler {:output-to "resources/public/js/compiled/ajedrez1.js"
                           :main ajedrez1.core
                           :optimizations :advanced
                           :pretty-print false}}]}

  :figwheel {:css-dirs ["resources/public/css"] ;; watch and update CSS}

  :profiles {:dev {:dependencies [[binaryage/devtools "1.0.0"]
                                  [figwheel-sidecar "0.5.20"]]
                   :source-paths ["src" "dev"]
                   :clean-targets ^{:protect false} ["resources/public/js/compiled"
                                                     :target-path]}})

它抛出:


Figwheel: Cutting some fruit, just a sec ...
Figwheel: Validating the configuration found in project.clj
Figwheel: Configuration Valid ;)
Figwheel: Starting server at http://0.0.0.0:3449
Figwheel: Watching build - dev
Figwheel: Cleaning build - dev
Compiling build :dev to "resources/public/js/compiled/out/index.js" from ["src"]...
Failed to compile build :dev from ["src"] in 16.531 seconds.
----  Exception    ----

  clojure.lang.ExceptionInfo : :build-cmd :none failed
         java.io.IOException : Cannot run program "npx.cmd": CreateProcess error=2, El sistema no puede encontrar el archivo especificado
         java.io.IOException : CreateProcess error=2, El sistema no puede encontrar el archivo especificado

我试着拔出:

:exclusions [cljsjs/react cljsjs/react-dom cljsjs/react-dom-server]]
:target :bundle
:bundle-cmd {:none ["npx.cmd" "webpack" "--mode=development"]
              :default ["npx.cmd" "webpack"]}

因为之前的项目没有它并成功编译,但浏览器只显示“Figwheel 模板 Checkout your developer console”。在控制台上显示“加载资源失败:服务器响应状态为 404(未找到)”。

添加后我尝试使用“lein clen”:

:clean-targets ^{:protect false} [:target-path
                                    [:cljsbuild :builds :app :compiler
                                     :output-dir]
                                    [:cljsbuild :builds :app :compiler
                                     :output-to]]

但它是一样的。

以防万一,当我多次评估相同的表达式时,我一直在经历 repl 的堆栈溢出,每次重复评估的时间都会增加。我必须定期重新启动它。

4

0 回答 0