我正在尝试使用yarn start命令为我的应用程序提供服务。
但是我有一个我不能理解的错误:
yarn run v1.22.4
warning package.json: "dependencies" has dependency "react-scripts" with range "3.2.0" that collides with a dependency in "devDependencies" of the same name with version "^3.4.1"
$ nx serve
> nx run phoenix:serve
FOLDER\front\node_modules\.bin\react-app-rewired:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
at wrapSafe (internal/modules/cjs/loader.js:1172:16)
at Module._compile (internal/modules/cjs/loader.js:1220:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1277:10)
at Module.load (internal/modules/cjs/loader.js:1105:32)
at Function.Module._load (internal/modules/cjs/loader.js:967:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47
error Command failed with exit code 1.我将NodeJS升级到了最新版本。我还有最新版本的Yarn。
我真的迷失在这里,不知道该怎么办?
发布于 2020-09-23 18:34:21
在Windows上,不要使用node_modules/.bin目录中的react-app-rewired脚本,而要使用react-app-rewired/bin目录中的脚本。
在workspace.json中
来自:"command": "node ../../node_modules/.bin/react-app-rewired start",
收件人:"command": "node ../../node_modules/react-app-rewired/bin/index.js start",
https://stackoverflow.com/questions/63300810
复制相似问题