gulp 相关问题

Gulp是一个JavaScript构建系统,基于Node.js的任务运行器,如Grunt。 Gulp使用流和代码配置来实现更简单,更直观的构建过程。

在 Safari 中执行 JavaScript 代码时出错

我在 MacBook 和 iPhone 上测试时遇到了 JS 运行时错误。苹果软件不早于2017年,估计是ES6+的兼容问题。 在我的代码中,我使用这样的模块: //

回答 0 投票 0

错误:找不到模块“浏览器同步”

我什么时候尝试开始大口服务 它引发了一个错误 模块.js:338 抛出错误; ^ 错误:找不到模块“浏览器同步” 在 Function.Module._resolveFilename (module.js:3...

回答 4 投票 0

SPFX 构建错误 - gulp 构建未按预期工作

我使用下面的命令“set NODE_OPTIONS=--max-old-space-size=216384”增加了内存大小,但没有用仍然得到相同的错误

回答 0 投票 0

在 Gulp 管道中未调用 `on("end")` 处理程序的原因通常是什么?

没有 MWE,我不希望有人会准确回答我的情况。我要问的是通常可能是什么原因。知道这一点,我会继续调查......

回答 0 投票 0

Another ParseError: 'import' and 'export' may appear only with 'sourceType: module' :(

我花了好几天时间在互联网上搜索解决这个问题(请不要将其标记为重复!)。我正在尝试使用 ES6 导入: 从“下划线”导入 * 作为 _; <--- w...

回答 1 投票 0

`.pipe()` 方法在 Gulp/Vinyl 中已被弃用,但它的替代方案是什么?

/** * @deprecated 此方法已在 v2.0 中删除。 * 如果 file.contents 是一个缓冲区,它将把它写入流中。 * 如果 file.contents 是一个 Stream,它会将其通过管道传输到流中。 ...

回答 0 投票 0

任何 npm、gulp 命令都会返回错误,并且只能在 admin 中运行

尝试在 Git Bash/PS 中运行任何 npm/gulp 命令时出现以下错误 npm 安装 内部/fs/utils.js:269 抛出错误; ^ 错误:EPERM:不允许操作,lstat 'C:\Users\<

回答 1 投票 0

在 docker 容器中找不到本地 gulp

我正在尝试重建一个关于 Django 和 gulp.js 的过去项目。 Gulp 用于从 Django 构建静态资产。我现在正在对这个项目进行码头化。为了做到这一点,我正在使用 python 和...

回答 1 投票 0

Gulp partials 和 Jekyll _includes:如何同时使用两者?

我是 Gulp 的新手。我正在使用使用了部分的 Gulp 模板。我不想更改模板并按给定的方式使用它并在我需要的地方添加我的 Jekyll _includes/... 在 gulpfile.js 部分...

回答 1 投票 0

在 chokidar.on() 回调中运行 gulp 任务

Gulp 任务“复制图像”在第一次 gulp 运行时复制所有图像文件。然后,任务“观察源文件”观察图像源文件夹,imagesWatcher.on('add) 拦截添加的文件。我怎么能...

回答 1 投票 0

Gulp + BrowserSync 启动 localhost:3000 但从未完全加载/连接

每当我运行 Gulp 命令将本地服务器启动到 localhost3000 时,它似乎在终端中运行,但它从未在浏览器中完全连接。装载轮一直在旋转结束......

回答 0 投票 0

如何让gulp识别@路径

当我在我的项目(react 18)中运行 gulp 命令时,显示错误: src/service/chat/ConversationItemService.ts(2,38): 错误 TS2307: 找不到模块 '@/models/request/conversation/ConversationItemReq'...

回答 0 投票 0

我无法将数据从表单接收到服务器端代码。基于 node.js 的站点

html 表单代码。它的简单名称,第二个名字,电话,邮件,带有提交按钮的消息(textarea teg *)。 html 表单代码。它的简单名称,第二个名字,电话,邮件,带有提交按钮的消息(textarea teg *)。 <form method="post" class="register-form" id="contact-form"> <div class="row"> <div class="col-sm-6"> <label for="firstName" class="mb-1">First name <span class="text-danger">*</span></label> <div class="input-group mb-3"> <input name="first-name" type="text" class="form-control" id="firstName" required placeholder="First name" aria-label="First name"> </div> </div> <div class="col-sm-6 "> <label for="lastName" class="mb-1">Last name</label> <div class="input-group mb-3"> <input name="last-name" type="text" class="form-control" id="lastName" placeholder="Last name" aria-label="Last name"> </div> </div> <div class="col-sm-6"> <label for="phone" class="mb-1">Phone <span class="text-danger">*</span></label> <div class="input-group mb-3"> <input name="phone" type="text" class="form-control" id="phone" required placeholder="Phone" aria-label="Phone"> </div> </div> <div class="col-sm-6"> <label for="email" class="mb-1">Email<span class="text-danger">*</span></label> <div class="input-group mb-3"> <input name="email" type="email" class="form-control" id="email" required placeholder="Email" aria-label="Email"> </div> </div> <div class="col-12"> <label for="yourMessage" class="mb-1">Message <span class="text-danger">*</span></label> <div class="input-group mb-3"> <textarea class="form-control" id="yourMessage" required placeholder="How can we help you?" style="height: 120px"></textarea> </div> </div> </div> <button id="submit" type="submit" class="btn btn-primary mt-4">Get in Touch</button> </form> js 代码,用于从表单中收集数据。 我还尝试为我的所有输入制作 5 const,但它仍然没有发送到服务器。 <script type="text/javascript"> const form = document.querySelector('#contact-form'); const message = document.getElementById('yourMessage') form.addEventListener('submit', (event) => { event.preventDefault(); //collecting <form> data const formData = new FormData(form); formData.append('message',message.value) fetch('/contact', { method: 'POST', body: formData }) .then(function(response) { return response.json(); }) .then(function(data) { console.log(data); }) .catch(function(error) { console.error(error); }) }); </script> 服务端代码基于 gulpfile.js 我不明白怎么了。 我只是猜测问题出在 bodyparser 上,但 idk. const bodyParser = require("body-parser"); const nodemailer = require("nodemailer"); const express = require("express"); const app = express(); app.use(express.static("dist")); app.use(bodyParser.json()); //nodemailer app.use(express.urlencoded({ extended: false })); app.post("/contact", (req, res) => { const formData = req.body.name; res.json({ message: "Form data received!", formData: formData }); console.log(formData); //{undefined} but i need data like {name: ... , mail: ...} 我解决了。我需要做的所有事情: <form method="post" action="/contact"> 服务器端代码: const urlencodedParser = express.urlencoded({ extended: false }); app.post("/contact", urlencodedParser, (req, res) => { if (!req.body) return res.sendStatus(400)})

回答 1 投票 0

在gulp.src()中获取当前文件名

在我的 gulp.js 文件中,我将示例文件夹中的所有 HTML 文件流式传输到构建文件夹中。 创建 gulp 任务并不困难: var gulp = require('gulp'); gulp.task('例子', 函数...

回答 7 投票 0

Setting a gulp src path?

我正在使用 gulp aws publish 将文件上传到 S3。 返回 gulp.src('/prod/assets/**/*') 上面是我的资产路径,它上传了资产文件夹中的所有内容,但是我如何指定 pat...

回答 1 投票 0

当我尝试运行 `npm run dev-server` 时得到 `node:events:505 throw er; // 未处理的“错误”事件 ^` .我不应该能够启动我的服务器

我正在处理一个包含 JSON 文件包的项目: { “名称”:“abc-app”, “版本”:“0.0.0”, "description": "Lorem ipsum dolor sit...

回答 0 投票 0

找不到模块‘gulp’

当我运行 ionic build android 命令时,出现以下错误: 警告:ionic.project 已重命名为 ionic.config.json,请重命名。 呃哦!看起来你的

回答 2 投票 0

运行安装 npm 时如何修复错误 403?

当我运行 npm install gulp 时从 cmd,我得到这个错误。

回答 0 投票 0

Gulp - 类型错误:不是函数。如何搜索问题的关键?

gulp文件代码: 让预处理器='sass'; const {app, dest, parallel, watch} = require('gulp'), browserSync = require('browser-sync').create(), concat = require('gulp-concat'), ...

回答 2 投票 0

gulp 不识别顺风类

我正在尝试使用 gulp、sass 和 tailwindcss 进行配置,一切正常,但是当我第一次运行 gulp 时,我可以看到应用了顺风类,但是当我尝试添加更多类时,我看不到

回答 0 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.