Open cater111 opened 3 years ago
windows 不支持命令行里的用环境变量,要修改package.josn文件中scripts里相关命令中的环境变量,直接使用对应的值。 例如jaeger-ui/packages/plexus/package.json中"prepublishOnly": "$npm_execpath build",$npm_execpath 改为yarn; "build": "NODE_ENV=production npm-run-all -ln --serial _tasks/clean/* _tasks/bundle-worker --parallel _tasks/build/**",NODE_ENV=production去掉要用这个变量的地方直接用值production代替,如"_tasks/build/umd": "webpack --mode $NODE_ENV --config webpack.umd.config.js"处。 类似的还要处理jaeger-ui/packages/jaeger-ui/package.json,才能让项目运行起来。
Windows does not support the use of environment variables in the command line. You need to modify the environment variables in the relevant commands in the scripts in the package.josn file and use the corresponding values directly.
For example, in jaeger-ui/packages/plexus/package.json,
"prepublishOnly": "$npm_execpath build"
change $npm_execpath to yarn;
"build": "NODE_ENV=production npm-run-all -ln --serial _tasks/clean/* _tasks/bundle-worker --parallel _tasks/build/**"
, remove NODE_ENV=production and use production when you need, like"_tasks/build/umd": "webpack --mode $NODE_ENV --config webpack.umd.config.js"
.
yarn 报错
[4/4] Building fresh packages... lerna notice cli v3.13.0 lerna info versioning independent lerna info Executing command in 1 package: "yarn run prepublishOnly" @jaegertracing/plexus: yarn run v1.22.11 @jaegertracing/plexus: $ $npm_execpath build @jaegertracing/plexus: '$npm_execpath' �����ڲ����ⲿ���Ҳ���ǿ����еij��� @jaegertracing/plexus: ���������ļ��� @jaegertracing/plexus: error Command failed with exit code 1. @jaegertracing/plexus: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. lerna ERR! yarn run prepublishOnly exited 1 in '@jaegertracing/plexus' error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.