arco-design / arco-design-pro-vue

An out-of-the-box solution to quickly build enterprise-level applications based on Arco Design.
https://pro.arco.design
MIT License
1.34k stars 275 forks source link

初始化项目失败,不支持可选链(Unexpected token '.') #31

Closed ok958726 closed 2 years ago

ok958726 commented 2 years ago

基本信息

预期结果

能顺利的初始化

复现步骤

初始化pro项目直接报错,显示的是不能识别可选链语法。 \node_modules\arco-design-pro-vue\scripts\vite.js:123 option.excludes?.find((name) => ^SyntaxError: Unexpected token '.

sHow8e commented 2 years ago

@ok958726 node版本建议14+。 这个问题下一个版本会做个语法处理。3q

sHow8e commented 2 years ago

@ok958726 v.2.2.5

heycms commented 2 years ago

我的用 npm i -g arco-cli 然后 arco init hello-arco-pro,也提示 初始化项目失败 项目依赖安失败,你可以稍后尝试手动安装项目依赖 Command Error: npm install

手动安装也不成功。提示 npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: arco-design-pro-vue@1.0.0 npm ERR! Found: eslint@8.11.0 npm ERR! node_modules/eslint npm ERR! dev eslint@"^8.7.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer eslint@"^5.16.0 || ^6.8.0 || ^7.2.0" from eslint-config-airbnb-base@14.2.1 npm ERR! node_modules/eslint-config-airbnb-base npm ERR! dev eslint-config-airbnb-base@"^14.2.1" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

windows 10 , 奇怪是的我在linux 上,一样的操作过程,可以顺利安装完。

sHow8e commented 2 years ago

@heycms 如果出现这个提示。可以尝试着先全局装个yarn,再走一遍流程。或者进入对应目录删掉node_modules再重新安装一遍。

heycms commented 2 years ago

@ok958726 全局有装yarn 的, 也不行,找不到是什么原因,试过用全新的虚拟机 WIN 环境下 也一样是这种情况。

createYourFirst commented 2 years ago

I also had this problem