遇到问题:

Vue CLI v4.5.6
┌─────────────────────────────────────────┐
│                                         │
│   New version available 4.5.6 → 5.0.4   │
│    Run npm i -g @vue/cli to update!     │
│                                         │
└─────────────────────────────────────────┘
......
npm ERR! gyp ERR! command "D:\\CODEInterpreter\\nodejs16.15\\node.exe" "D:\\CODEFile\\WebCode\\inurse-client\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd D:\CODEFile\WebCode\inurse-client\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.15.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Local\npm-cache\_logs\2022-06-15T08_17_24_167Z-debug-0.logERROR  command failed: npm install --loglevel error

产生原因

参考过其他博客中列举出的几条原因:

  • 重建项目
  • 清除缓存 : npm cache clean --force
  • 重装淘宝源 :npm install -g cnpm --registry=https://registry.npm.taobao.org
  • 修改useTaobaoRegistry : 修改C:\Users*****\ .vuerc 中 “useTaobaoRegistry”: true, 改为false
  • 重装node解释器
  • 删除npmrc文件 : npm install -g cnpm --registry=https://registry.npm.taobao.org
  • node版本问题 :将低版本,我就从17降到了14,但是没效果
  • css编辑工具选择 :配置 CSS 编译工具时不要选择 node-sass,应该选择 dart-sass
  • 管理员身份运行

解决方案

在创建配置项目时候,配置 CSS 编译工具时不要选择 node-sass,应该选择 dart-sass。

【Python异常】 NPM创建Vue项目遇到ERROR command failed: npm install --loglevel error相关推荐

  1. 使用npm创建vue项目

    大家好,我是龙骑士,今天给大家介绍使用npm创建vue项目 在你想要创建项目的文件夹下打开cmd,在命令行窗口输入vue create projectname 作为学习记录,这里全部选择 Vue CL ...

  2. 使用vue-cli3创建项目的时候出错,ERROR command failed: npm install --loglevel error --registry

    重点:方法三 命令: vue create vue-hello 错误提示: ERROR command failed: npm install --loglevel error --registry ...

  3. ERROR command failed: npm install --loglevel error --legacy-peer-deps

    一.问题场景 MacBook Air 创建 vue 项目时报错:ERROR command failed: npm install --loglevel error --legacy-peer-dep ...

  4. mac电脑解决Error: command failed: npm install --loglevel error --legacy-peer-deps

    使用vue create xxx创建vue3项目的时候报错. 解决步骤: 1.sudo npm cache clean --force 2.再次创建就可以成功 补充:网上搜到很多方法,都尝试失败,因为 ...

  5. 解决问题: Error: command failed: npm install --loglevel error --legacy-peer-deps

    在启动vue脚手架的时候,出现了一个错误: 在经过查询后 删除了.npmrc文件并且修改了.vuerc文件,但是依然不起作用 再修改vuerc文件 将useTaobaoRegistry修改为false ...

  6. ERROR Error: command failed: pnpm install --reporter silent --shamefully-hoist 错误解决办法

    使用 vue-cli.pnpm创建新项目遇到的错误如下图所示: 在命令行安装pnpm@6的版本: npm i pnpm@6 -g vue create hello-world 还可以直接使用npm安装 ...

  7. 脚手架创建遇到报错:Error: command failed: pnpm install --reporter silent --shamefully-hoist

    解决方式 : vue create frist-vue -m npm  把pnpm切换成npm

  8. 解决 ERROR command failed: npm install --loglevel error --legacy-peer-deps

    从原本的cmd环境换到管理员环境 或者powershell的管理员模式都可以

  9. 使用pnpm+vue-cli,出现报错:Error: command failed: pnpm install --reporter silent --shamefully-hoist

    问题描述: 因为发现pnpm好用,所以现在全面切为使用pnpm,但是通过pnpm和vue-cli创建项目的时候发生了报错: 解决办法: 将pnpm降级到6就可以: npm install pnpm@6 ...

最新文章

  1. 实验记录:vsftp整合mysql-pam管理虚拟账号
  2. 一个案例说出python的十余个语法知识点
  3. HDOJ 1298 T9(trie树简单应用)
  4. Jafka源码粗略解读之二--关于JMX
  5. scale和java比较_浅谈java中BigDecimal的equals与compareTo的区别
  6. 【渝粤教育】国家开放大学2018年秋季 0699-21T阅读与写作 参考试题
  7. [剑指offer]面试题第[59-2]题[JAVA][队列的最大值][暴力][双端队列]
  8. Linux学习第五篇之文件处理命令touch、cat、tac、more、less、head、tail
  9. mysql query cache
  10. 逻辑综合工具DesignCompiler使用教程
  11. 鸿星尔克向河南博物院捐款100万元用于灾后重建
  12. 手写Maven的archetype项目脚手架
  13. 胆战心惊形容什么_胆战心惊的近义词
  14. 【眼底图像数据集】视杯 视盘分割
  15. SAM数据格式学习1之CIGAR理解
  16. 面试磕磕碰碰,辛得蚂蚁高级工程师的技术笔记指导,终获P7岗offer
  17. javascript入门实例:实现简单网页功能
  18. Python入门习题大全——喜欢的水果
  19. wifi卡慢延迟高_家中无线突然很慢/卡顿怎么办?路由器增强WiFi信号的几种方法...
  20. API比较PostMessageA和SendMessageA游戏屏蔽

热门文章

  1. 【二】微信开发中的https
  2. Java小农养成记第十三天
  3. 关于硕士研究生延毕的几问几答
  4. Unity之人脸识别对比(二)获取摄像头图像以及保存
  5. 卖车只是敲门砖,从“硬件升级”到“主动召回”,李想并不理想
  6. 冲冠一怒为代码:论程序员与负能量
  7. 十六进制和BCD码的那些事(终结篇)
  8. 百度Paddle免费课程——从零开始学视觉Transformer
  9. 我们不做看客,只做时代的赋能者—FMI2018人工智能与大数据高峰论坛圆满落幕...
  10. Scratch少儿编程与游戏:狙击黑蝙蝠