npm install 出现 npm ERR! command failed 解决办法

这篇具有很好参考价值的文章主要介绍了npm install 出现 npm ERR! command failed 解决办法。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

本地使用npm install 时出现如下异常,可以看下本地是否安装过历史版本的node导致的版本冲突。

解决方案: 先将历史版本的 node 卸载,再重新安装后,再执行npm install

npm ERR! code 1
npm ERR! path C:\Users\li-671\Downloads\light-blue-vue-admin-master\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\Users\li-671\Downloads\light-blue-vue-admin-master\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli   'C:\\Users\\li-671\\Downloads\\light-blue-vue-admin-master\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@18.12.1 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb download using dist-url https://npm.taobao.org/dist
npm ERR! gyp verb find Python Python is not set from command line or npm configuration
npm ERR! gyp verb find Python Python is not set from environment variable PYTHON
npm ERR! gyp verb find Python checking if "python3" can be used
npm ERR! gyp verb find Python - executing "python3" to get executable path
npm ERR! gyp verb find Python - "python3" is not in PATH or produced an error
npm ERR! gyp verb find Python checking if "python" can be used
npm ERR! gyp verb find Python - executing "python" to get executable path
npm ERR! gyp verb find Python - executable path is "C:\ProgramData\Anaconda3\python.exe"
npm ERR! gyp verb find Python - executing "C:\ProgramData\Anaconda3\python.exe" to get version
npm ERR! gyp verb find Python - version is "3.9.12"
npm ERR! gyp info find Python using Python version 3.9.12 found at "C:\ProgramData\Anaconda3\python.exe"
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 18.12.1
npm ERR! gyp verb command install [ '18.12.1' ]

 转自下面这篇文章
npm install 时 node-sass npm ERR command failed问题解决文章来源地址https://www.toymoban.com/news/detail-532182.html

到了这里,关于npm install 出现 npm ERR! command failed 解决办法的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包赞助服务器费用

相关文章

  • 解决npm install报错 npm ERR! gyp ERR! cwd D:\Projec\xxx\node_modules\node-sass (node-sass版本问题)

    解决npm install报错 npm ERR! gyp ERR! cwd D:\Projec\xxx\node_modules\node-sass (node-sass版本问题)

    vue项目换电脑后npm install发现一直报如下的错误: node-sass版本不兼容,比较老。还出现找不到python路径的错误。node-sass 需要 node-gyp安装时需要进行转译所以可能会出现各种按安装问题。且node-sass 本身就已经是deprecated状态了。如果不是维护老项目不建议再使用 由于它只用于开

    2024年02月09日
    浏览(14)
  • npm install报错npm ERR! gyp ERR! node -v v16.18.1npm ERR! gyp ERR! node-gyp -v v3.8.0npm ERR! gyp ER

    npm install报错npm ERR! gyp ERR! node -v v16.18.1npm ERR! gyp ERR! node-gyp -v v3.8.0npm ERR! gyp ER

    这是 node-sass、sass-loader 安装的版本和电脑安装的 node.js 版本不兼容导致的错误 我的node.js版本是16.18.1 在项目目的package.json文件把 node-sass 和 sass-loader 的修改成如下版本,npm install 安装成功 node-sass:^6.0.1 sass-loader:^6.0.7 如果你的nodejs是其他版本,可以自行查询node-sass和sas

    2024年02月13日
    浏览(19)
  • npm install 报错 ERR! gyp ERR! node-sass python

    一、问题描述: npm install 报错 ERR! gyp ERR! ERR! stack Error: Can\\\'t find Python executable \\\"python\\\", you can set the PYTHON env variable node -v v16 node-gyp -v v3.8.0 二、可能原因 1 nodejs与sass版本不匹配(可能性最大:解决办法见三) node版本是16,sass版本是4.14。重装的node ,就好了。其他两个是调查时看到

    2024年02月03日
    浏览(53)
  • npm install出现npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve

    PS E:myvuebookshop npm i npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR!  npm ERR! While resolving: @vue/eslint-config-standard@6.1.0 npm ERR! Found: eslint-plugin-vue@8.7.1 npm ERR! node_modules/eslint-plugin-vue npm ERR!   dev eslint-plugin-vue@\\\"^8.0.3\\\" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! p

    2024年02月11日
    浏览(50)
  • 如何解决npm install 的报错npm ERR! network request to http://registry.cnpmjs.org/vue-cli failed

    报错: 解决方法: npm ERR! network request to http://registry.cnpmjs.org/vue-cli failed, reason: getaddrinfo ENOTFOUND 这句话已经很明显的提示 http://registry.cnpmjs.org/vue-cli 请求失败了,但网上其他博客还是让代理这个路径。试了网上很多方法都没有用。最后执行了以下语句,执行成功 直接代理淘

    2024年02月04日
    浏览(47)
  • 深入解析npm ERR! cwebp-bin@6.1.2 postinstall: `node lib/install.js`错误及解决方案

    在开发过程中,我们经常会遇到各种各样的错误。其中,npm ERR! cwebp-bin@6.1.2 postinstall: node lib/install.js 是一个比较常见的错误。本文将详细介绍这个错误的产生原因以及解决方案。 首先,我们需要了解这个错误的含义。npm ERR! cwebp-bin@6.1.2 postinstall: node lib/install.js 表示在安装

    2024年02月02日
    浏览(89)
  • npm install运行报错npm ERR! gyp ERR! not ok问题解决

    npm install运行报错npm ERR! gyp ERR! not ok问题解决

    执行 npm install 的时候报错: 根据报错信息,看出时node-sass运行出现问题 解决: 1.查看当前环境node版本 我这里是20.11.0 2.在package.json中查看node-sass的版本: 2.1package.json中有node-sass 我这里node-sass的版本是4.14.4 根据下图查看node和node-sass版本是否匹配 如果node和node-sass版本不符合

    2024年01月24日
    浏览(50)
  • npm install齐天大坑!!!gyp ERR! find VS msvs_version not set from command line or npm config

    npm install齐天大坑!!!gyp ERR! find VS msvs_version not set from command line or npm config

    1、卸载nodejs重新安装一遍 2、设置淘宝镜像 npm config set registry https://registry.npm.taobao.org 3、安装nodejs所需的环境(Visual Studio XX、python什么鬼的),执行这个命令会自动检测并帮你安装好,npm install --g --production windows-build-tools 4、关键所在!!!执行编译时指定python版本,npm ins

    2024年02月13日
    浏览(11)
  • npm install错误——npm ERR! code ERESOLVE 解决方法(亲测有效)

    npm install错误——npm ERR! code ERESOLVE 解决方法(亲测有效)

    最近node用nvm来管理,nvm安装在这里   nvm的环境变量   path中配置       正在使用的node版本的软连接在这里  vue项目执行npm install的时候报如下错误 添加--legacy-peer-deps即可正常                

    2024年02月14日
    浏览(10)
  • 解决npm install版本不匹配问题: npm ERR! code ETARGET npm ERR! notarget No matching version found for

    解决npm install版本不匹配问题: npm ERR! code ETARGET npm ERR! notarget No matching version found for

    以nodemon包为例: npm view nodemon 终端执行结果为: 2.带上版本号重新安装 npm install nodemon@2.0.20 即可成功

    2024年02月11日
    浏览(12)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包