简体   繁体   English

cljs.closure/build (closure.clj:319 3) 处的执行错误 (ExceptionInfo)。 :bundle-cmd:none 失败 — clojurescript 与 webpack

[英]Execution error (ExceptionInfo) at cljs.closure/build (closure.clj:319 3). :bundle-cmd :none failed — clojurescript with webpack

I'm trying to run the official example https://clojurescript.org/guides/webpack on windows and I get the following error when I execute it:我正在尝试在 windows 上运行官方示例https://clojurescript.org/guides/webpack ,执行时出现以下错误:

Execution error (ExceptionInfo) at cljs.closure/run-bundle-cmd (closure.clj:3037).
:bundle-cmd :none failed

I the full report says the following:我的完整报告如下:

"[webpack-cli] [31mUnknown command 'out/index.js'[39m\n[webpack-cli] [31mRun 'webpack --help' to see available commands and options[39m\n"

I tried changing the suggested "npx" and "webpack" commands with:我尝试使用以下命令更改建议的“npx”和“webpack”命令:

"npx.cmd"

and with the possibles absolute paths:并使用可能的绝对路径:

"C:/Users/usuario/AppData/Roaming/npm/npx.cmd" and "C:/Users/usuario/AppData/Roaming/npm/npx.cmd"

"C:/Program Files/nodejs/npx.cmd"

...the same for "webpack" ...对于“webpack”也是如此

Also tried changing 'out/index.js' to './out/index.js' and using {:deps {org.clojure/clojurescript {:mvn/version "1.10.773"}}} version instead of 1.10.741 suggested in the tutorial.还尝试将 'out/index.js' 更改为 './out/index.js' 并使用 {:deps {org.clojure/clojurescript {:mvn/version "1.10.773"}}} 版本而不是 1.10.741教程中建议。

Any idea for what is going on?知道发生了什么吗?

Make the changes suggested by this post https://dev.to/romanliutikov/integrating-clojurescript-with-javascript-tooling-3799 and it works.进行这篇文章https://dev.to/romanliutikov/integrating-clojurescript-with-javascript-tooling-3799建议的更改,它可以工作。

I changed :bundle-cmd to :none ["C:/Program Files/nodejs/npx.cmd" "C:/Users/usuario/AppData/Roaming/npm/webpack.cmd" "--mode=development"]我将:bundle-cmd更改为:none ["C:/Program Files/nodejs/npx.cmd" "C:/Users/usuario/AppData/Roaming/npm/webpack.cmd" "--mode=development"]

and add the following webpack.config.js module.exports = { entry: "./out/index.js", output: { path: __dirname, filename: "bundle.js" } }并添加以下 webpack.config.js module.exports = { entry: "./out/index.js", output: { path: __dirname, filename: "bundle.js" } }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM