gpt4 book ai didi

node.js - 命令 npm install swiper 失败 - 代码 255

转载 作者:行者123 更新时间:2023-12-02 01:28:11 28 4
gpt4 key购买 nike

当我尝试运行 npm install 时,swiper 抛出错误。我尝试在本地和全局范围内安装 swiper:

npm install swiper
npm install -g swiper

我在全局范围内成功安装了它。但是当我再次尝试安装时,错误还是一样。

这里是错误:

npm ERR! code 255
npm ERR! path C:\Users\Emir\Desktop\Project\portal\node_modules\swiper
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c
C:\Users\Emir\AppData\Local\Temp\postinstall-cab5f01a.cmd
npm ERR! "Love Swiper? Support Vladimir's work by donating or pledging on patreon:"
npm ERR! The syntax of the command is incorrect.

最佳答案

嘿,你可能和我一样是 Windows 用户。

我通过设置环境变量修复了这个错误

swiper 安装后文件有问题

https://github.com/nolimits4web/swiper/blob/master/src/copy/postinstall.js

你需要绕过这个

function isBannerRequired() {
return !(ADBLOCK || CI || DISABLE_OPENCOLLECTIVE || SILENT || OPEN_SOURCE_CONTRIBUTOR);
}

所以在vs代码里面打开一个终端并写入绕过相等测试

 $env:OPEN_SOURCE_CONTRIBUTOR="true"

然后尝试 npm 安装

关于node.js - 命令 npm install swiper 失败 - 代码 255,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73946296/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com