yarn create umi报错

摘要:
选择油板类型和设计专业?Bethefirsttoexperiencethenewumi@3 ? ProV4?你想用什么语言?TypeScript?你需要所有的木块或简易脚手架吗?易于理解的

根据ant-design-pro官网https://pro.ant.design/docs/getting-started-cn的安装提示,在项目目录下使用git命令运行yarn create umi,然后报错,报错的大概意思就是权限不足,

$ yarn create umi
yarn create v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.11: The platform "win32" is incompatible with this module.
info "fsevents@1.2.11" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-umi@0.26.0" with binaries:
- create-umi
error An unexpected error occurred: "EPERM: operation not permitted, unlink 'C:\Program Files\nodejs\node_global\bin\create-next-app'".
info If you think this is a bug, please open a bug report with the information provided in "C:\Users\86181\AppData\Local\Yarn\Data\global\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

然后使用管理员权限打开node,切换到目录下,重新运行yarn create umi,结果又报错了

D:genuineadmin>yarn create umi
yarn create v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.11: The platform "win32" is incompatible with this module.
info "fsevents@1.2.11" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...

warning Your current version of Yarn is out of date. The latest version is "1.22.5", while you're on "1.22.4".
info To upgrade, run the following command:
$ curl --compressed -o- -L https://yarnpkg.com/install.sh | bash
success Installed "create-umi@0.26.0" with binaries:
- create-umi
'C:Program' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
error Command failed.
Exit code: 1
Command: C:Program Files odejs ode_globalincreate-umi
Arguments:
Directory: D:genuineadmin
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

这里提示我的yarn版本低了,先升级yarn版本,可以使用npm i yarn@latest -g来安装最新版本的yarn

但是升级后再次运行,还是报错,报错内容后上面一样,只是没报yarn版本的错误

在网上搜了下,说修改create-umi.cmd文件路径,但是我试了一下,修改保存会提示没有权限

我直接在项目运行create-umi,结果竟然成功了

create-umi
? Select the boilerplate type ant-design-pro
? � Be the first to experience the new umi@3 ? Pro V4
? � Which language do you want to use? TypeScript
? � Do you need all the blocks or a simple scaffold? simple
? � Time to use better, faster and latest antd@4! antd@4
Cloning into 'D:genuineadmin'...
remote: Enumerating objects: 199, done.
remote: Counting objects: 100% (199/199), done.
remote: Compressing objects: 100% (184/184), done.
remote: Total 199 (delta 30), reused 72 (delta 9), pack-reused 0R Receiv
Receiving objects: 100% (199/199), 300.08 KiB | 165.00 KiB/s, done.
Resolving deltas: 100% (30/30), done.
> � clone success
> Clean up...
✨ File Generate Done

然后思考了一下,真正创建项目的命令是create-umi  一开始的yarn create umi其实是全局安装这个命令,就和我们使用vue-cli需要安装vue create一样

如果你也遇到这个问题,不妨试一下分两步运行命令1. yarn create umi  2.create-umi 注意create-umi中间是横线连着的

免责声明:文章转载自《yarn create umi报错》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇【解决】Uncaught SyntaxError: Unexpected end of JSON input at JSON.parseDTV(数字电视)知识扫盲下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

【原创】大叔经验分享(21)yarn中查看每个应用实时占用的内存和cpu资源

在yarn中的application详情页面 http://resourcemanager/cluster/app/$applicationId 或者通过application命令 yarn application -status $applicationId 只能看到应用启动以来占用的资源*时间统计,比如: Aggregate Resource Allo...

批量杀死yarn任务

for i in yarn application -list | grep -w ACCEPTED | awk '{print $1}' | grep application_; do yarn application -kill $i; done...

java.nio.channels.ClosedChannelException

ERROR client.TransportClient: Failed to send RPC RPC 7651764253676103503 to /10.169.12.139:45996: java.nio.channels.ClosedChannelException原因:给节点分配的内存少,yarn kill了spark application...

Spark应用程序运行的日志存在哪里(转)

原文链接:Spark应用程序运行的日志存在哪里 在很多情况下,我们需要查看driver和executors在运行Spark应用程序时候产生的日志,这些日志对于我们调试和查找问题是很重要的。   Spark日志确切的存放路径和部署模式相关:  (1)、如果是Spark Standalone模式,我们可以直接在Master UI界面查看应用程序的日志,在默认...

自定义yarn运行vue项目命令

  在项目中的package.json文件的scripts块中可以看到新项目的yarn命令集合 "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", "lint": "vue-cli-service lint" },...

“There appears to be trouble with your network connection. Retrying”

网上很多答案都说是代理问题,不过,设置了代理还是提示这个,后来删除了 yarn.lock 文件后重新 yarn 就好了。估计是 yarn.lock 中包的路径有错,所以一直加载失败。出现此问题可能是 npm 和 yarn 混用导致的。当然,也有可能真的是网络问题。 删了 yarn.lock 文件依然无效可以试下设置代理镜像 yarn config set...