前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Vue项目 npm 报错npm ERR! code 1

Vue项目 npm 报错npm ERR! code 1

作者头像
不爱吃糖的程序媛
发布2024-01-18 21:27:05
5540
发布2024-01-18 21:27:05
举报
前提条件

node已经安装好了,运行命令 npm install

报错展示
代码语言:javascript
复制
npm ERR! code 1
npm ERR! path D:\workspace\exchange\exchange-web\exchange-web-ui\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@13.6.0 | win32 | x64
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack     at PythonFinder.failNoPython (D:\workspace\exchange\exchange-web\exchange-web-ui\node_modules\node-gyp\lib\configure.js:484:19)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (D:\workspace\exchange\exchange-web\exchange-web-ui\node_modules\node-gyp\lib\configure.js:509:16)
npm ERR! gyp ERR! stack     at callback (D:\workspace\exchange\exchange-web\exchange-web-ui\node_modules\graceful-fs\polyfills.js:299:20)
npm ERR! gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:166:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19043
npm ERR! gyp ERR! command "D:\\software\\node\\node.exe" "D:\\workspace\\exchange\\exchange-web\\exchange-web-ui\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd D:\workspace\exchange\exchange-web\exchange-web-ui\node_modules\node-sass
npm ERR! gyp ERR! node -v v13.6.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
原因

项目package.json的配置太低,用最新版的node运行不起来 解决方式: 1.卸载node16 ,重新下载安装 node v12.13.1 2.再重新拉取项目, 或者删除node_module

在这里插入图片描述
在这里插入图片描述

目测成功!

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2022-09-22,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 前提条件
  • 报错展示
  • 原因
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档