错误TS2305:模块'“http”'没有导出成员'OutgoingHttpHeaders'。(error TS2305: Module '“http”' has no exported member 'OutgoingHttpHeaders'. when trying to add electron-updater into electron project)
我正在使用https://github.com/maximegris/angular-electron样板来启动电子应用程序。 克隆之后,我只进行了两次以下的更改,以便开始设置autoUpdater:
安装电子更新程序:
npm install electron-updater --save
和
main.ts
文件中的以下行:import { autoUpdater } from 'electron-updater';
在此之后,当我尝试尝试启动应用程序时,我得到以下错误:
node_modules/electron-updater/node_modules/builder-util-runtime/out/httpExecutor.d.ts(2,27): error TS2305: Module '"http"' has no exported member 'OutgoingHttpHeaders'. node_modules/electron-updater/out/AppUpdater.d.ts(4,10): error TS2305: Module '"http"' has no exported member 'OutgoingHttpHeaders'. node_modules/electron-updater/out/Provider.d.ts(3,10): error TS2305: Module '"http"' has no exported member 'OutgoingHttpHeaders'. npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! angular-electron@2.6.0 build:electron:main: `tsc main.ts --outDir dist && copyfiles package.json dist && cd dist && npm install --prod && cd ..` npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the angular-electron@2.6.0 build:electron:main script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/harshveer/.npm/_logs/2018-02-13T09_30_46_752Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! angular-electron@2.6.0 electron:serve: `npm run build:electron:main && electron ./dist --serve` npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the angular-electron@2.6.0 electron:serve script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/harshveer/.npm/_logs/2018-02-13T09_30_46_777Z-debug.log ERROR: "electron:serve" exited with 2. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! angular-electron@2.6.0 start: `npm-run-all --parallel webpack:watch electron:serve` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the angular-electron@2.6.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/harshveer/.npm/_logs/2018-02-13T09_30_46_902Z-debug.log
知道如何解决这个问题,
I am using https://github.com/maximegris/angular-electron boilerplate to start electron app. After cloning this, I have made only below two changes in effort to start setting up autoUpdater:
Install electron-updater:
npm install electron-updater --save
and below line in
main.ts
file:import { autoUpdater } from 'electron-updater';
After this when I try try to start application I get below error:
node_modules/electron-updater/node_modules/builder-util-runtime/out/httpExecutor.d.ts(2,27): error TS2305: Module '"http"' has no exported member 'OutgoingHttpHeaders'. node_modules/electron-updater/out/AppUpdater.d.ts(4,10): error TS2305: Module '"http"' has no exported member 'OutgoingHttpHeaders'. node_modules/electron-updater/out/Provider.d.ts(3,10): error TS2305: Module '"http"' has no exported member 'OutgoingHttpHeaders'. npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! angular-electron@2.6.0 build:electron:main: `tsc main.ts --outDir dist && copyfiles package.json dist && cd dist && npm install --prod && cd ..` npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the angular-electron@2.6.0 build:electron:main script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/harshveer/.npm/_logs/2018-02-13T09_30_46_752Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! angular-electron@2.6.0 electron:serve: `npm run build:electron:main && electron ./dist --serve` npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the angular-electron@2.6.0 electron:serve script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/harshveer/.npm/_logs/2018-02-13T09_30_46_777Z-debug.log ERROR: "electron:serve" exited with 2. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! angular-electron@2.6.0 start: `npm-run-all --parallel webpack:watch electron:serve` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the angular-electron@2.6.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/harshveer/.npm/_logs/2018-02-13T09_30_46_902Z-debug.log
Any idea how to fix this,
原文:https://stackoverflow.com/questions/48763721
最满意答案
首先将月份转换为日期,如本月的第一天。 然后您可以比较日期以检查月份是否介于:
$month_day = date ('Y-m-01', strtotime($month) ); $date1_day = date ('Y-m-01', strtotime($date1) ); $date2_day = date ('Y-m-01', strtotime($date2) ); if ( ($month_day >= min($date1_day, $date2_day)) && ($month_day <= max($date1_day, $date2_day)) ) { }
First convert the month into a date, like the first day of the month. Then you can compare the dates to check if the month lies in between:
$month_day = date ('Y-m-01', strtotime($month) ); $date1_day = date ('Y-m-01', strtotime($date1) ); $date2_day = date ('Y-m-01', strtotime($date2) ); if ( ($month_day >= min($date1_day, $date2_day)) && ($month_day <= max($date1_day, $date2_day)) ) { }
相关问答
更多-
检查数据是否已经存在(check if data already exist)[2024-01-14]
首先使相关的一组属性成为表的主键或唯一索引。 那么你有几个选择: 一味地使用INSERT IGNORE INTO fbinvite ... ,如果你只是想忽略重复的数据或 检查是否存在条目: SELECT memberid FROM fbinvite WHERE some_attr1 = $explode[...] AND some_attr2 = $explode[...] ; 并适当地继续: 如果条目不存在,则将其插入表中: INSERT INTO fbinvite ... 如果条目存在: 向用户显示消 ... -
首先将月份转换为日期,如本月的第一天。 然后您可以比较日期以检查月份是否介于: $month_day = date ('Y-m-01', strtotime($month) ); $date1_day = date ('Y-m-01', strtotime($date1) ); $date2_day = date ('Y-m-01', strtotime($date2) ); if ( ($month_day >= min($date1_day, $date2_day)) && ($mont ...
-
检查一下 $datedata = "2014-10-19 12:36:00"; if(strtolower(date('F',strtotime($datedata))) == strtolower(date('F'))){ echo "success"; }else{ echo "unsucess"; } check this $datedata = "2014-10-19 12:36:00"; if(strtolower(date('F',strtotime($datedata))) ...
-
如何在每月的特定时段创建幂等工作?(How to create idempotent jobs on specific period of day range of month?)[2023-11-20]
IceCube (用于处理重复发生的事件)和RecurringSelect for GUI的组合可以在考虑到易用性和扩展性的情况下实现。 然后,您可以设置您的活动,例如: IceCube::Rule.monthly IceCube::Rule.monthly.day_of_month(-10) A combination of IceCube (to handle recurring events) and maybe RecurringSelect for a GUI would achieve thi ... -
这是一个符合您要求的简单测试用例: package test; import java.time.Duration; import java.time.Instant; import java.time.LocalDateTime; import java.time.Period; import java.time.ZoneId; public class Java8PeriodAndInstant2 { public static void main(String[] arg ...
-
使用属性equals选择器 $(this).find('#test').children('[title=No]').length > 0; Use the attribute equals selector $(this).find('#test').children('[title=No]').length > 0;
-
你应该使用BETWEEN - SELECT * FROM `events` WHERE `date` BETWEEN '2013-09-01' AND '2013-09-30'; 因为你的日期是以varchar的形式存储的(你真的应该修复它),所以你必须将字符串转换为日期格式然后搜索。 虽然表现会很糟糕 - WHERE STR_TO_DATE(`date`, '%m/%/d/%Y %h:%i:%s %p') BETWEEN STR_TO_DATE('2013-09-01', '%m/%/d/%Y') ...
-
我同意@arkascha的观点,如果该文件供内部使用,使用具有唯一散列的文件名将更好。 但如果有必要,请尝试使用foreach()立即检查数组中的前缀。 function files_suffix_exists($file_name, $folders){ $root = $_SERVER["DOCUMENT_ROOT"]; if(file_exists($root."/".$file_name . '.' . $extension){ return true; } ...
-
SELECT c.Customerid, MIN(c.pdate) AS startperiod, c1.endperiod, ( SELECT COUNT(temp.productid) FROM Customer temp WHERE temp.Customerid = c.Customerid AND temp.pdate >= MIN(c.pdate) AND temp.pdate <= c1.endperiod GROUP BY temp.produc ...
-
要将给定时间与当前时间进行比较: if (strtotime($given_time) >= time()+300) echo "You are online"; 300是您想要检查的秒数之差。 在这种情况下,5分60秒。 如果要比较两个任意时间,请使用: if (strtotime($timeA) >= strtotime($timeB)+300) echo "You are online"; 请注意 :如果时间在不同的日期,例如星期五23:58和星期六00:03,这将失败,因为您只是将时间作为变量传 ...