小编JN_*_*bie的帖子

引擎“节点”与此模块不兼容

部署到 AWS 时,我遇到了纱线错误

error fs-extra@7.0.1: The engine "node" is incompatible with this module. Expected version ">=6 <7 || >=8". Got "7.0.0"
Run Code Online (Sandbox Code Playgroud)

知道这将如何解决吗?

如果我在 package.json 中指定引擎,这会解决吗

{ 
  "engines" : { 
    "node" : ">=8.0.0" 
  }
}
Run Code Online (Sandbox Code Playgroud)

dependencies node.js npm yarnpkg

121
推荐指数
11
解决办法
12万
查看次数

为什么在调用JasperFillManager时在java.lang.Class.isAssignableFrom(Native Method)中得到java.lang.NullPointerException?

当我在其参数中传递sql连接时,JasperFillManager抛出一个空指针异常,但是当我传递JRResultSetDatasource时它运行正常.

java.lang.NullPointerException
at java.lang.Class.isAssignableFrom(Native Method)
at net.sf.jasperreports.engine.fill.JRFillTextField.getFormat(JRFillTextField.java:706)
at net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:394)
at net.sf.jasperreports.engine.fill.JRFillTextField.evaluate(JRFillTextField.java:368)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:258)
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:499)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2036)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:760)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:270)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:128)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:946)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:845)
at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:609)
at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59)
at net.sf.jasperreports.engine.fill.JRThreadSubreportRunner.run(JRThreadSubreportRunner.java:205)
at java.lang.Thread.run(Unknown Source)
Run Code Online (Sandbox Code Playgroud)

当我在fillReport中传递连接时,它会给出异常.

jasperPrint = JasperFillManager.fillReport(jasperReport, map, reportConnection);
Run Code Online (Sandbox Code Playgroud)

我也在使用子报表,这就是为什么我没有使用JRResultSetDatasource并使用连接.我只是坚持这个说明,当我传递JRResultSetDatasource它工作正常,当我也在HasMap参数中传递连接对象时,它给出与上面相同的错误.

java jasper-reports nullpointerexception

8
推荐指数
1
解决办法
2万
查看次数

node.js中的gm转换问题

我正在将图像从jpg转换为png,但它正在给出错误.下面是代码和错误.

gm('E:/image1.jpg').write('E:/image2.png', function(err){
        if (err){
            console.log(err);
        } else{console.log('image converted.')}
    })
Run Code Online (Sandbox Code Playgroud)

错误是:

[Error: Could not execute GraphicsMagick/ImageMagick: gm "convert" "E:/image1.jpg" "E:/image2.png" this most likely means the gm/convert binaries can't be found]
Run Code Online (Sandbox Code Playgroud)

我需要npm graphicsmagick和imagemagick吗?

javascript imagemagick node.js graphicsmagick

8
推荐指数
4
解决办法
9883
查看次数

模块“typeorm”没有导出成员“DataSource”和“DataSourceOptions”

我收到错误,Module '"typeorm"' has no exported member 'DataSource'.而.Module '"typeorm"' has no exported member 'DataSourceOptions'.nest build

npm install 之后,我使用nest build命令行命令构建了 Nestjs 应用程序,但出现了这些错误。

typeorm版本是“^0.2.25”,“@nestjs/typeorm”:“^8.0.2”,

无法弄清楚为什么会发生这种情况。

tsconfig.json

{
  "compilerOptions": {
    "module": "commonjs",
    "declaration": true,
    "removeComments": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "allowSyntheticDefaultImports": true,
    "target": "es2019",
    "sourceMap": true,
    "outDir": "./dist",
    "baseUrl": "./src",
    "incremental": true,
    "typeRoots": ["types", "node_modules/@types"],
    "strict": true,
    "esModuleInterop": true,
    "resolveJsonModule": true,
    "useUnknownInCatchVariables": false
  },
  "exclude": ["node_modules", "scripts", "dist"]
}
Run Code Online (Sandbox Code Playgroud)

ormconfig.ts

const DATABASE_TYPE = process.env.DATABASE_TYPE || 'postgres';
const DATABASE_URL …
Run Code Online (Sandbox Code Playgroud)

node.js npm typeorm nestjs

7
推荐指数
1
解决办法
9813
查看次数

在 apache 2.2.22 中启用 TLSv1.2

我需要更新 apache 2.2.22 以支持 TLSv1.2。我已经尝试了下面的命令,但它不起作用

SSLProtocol +TLSv1.2 +TLSv1.1 +TLSv1
Run Code Online (Sandbox Code Playgroud)

但是当我放置这个命令时,它会在 Windows 事件查看器中显示一个错误

SSLProtocol: Illegal protocol 'TLSv1.2'
Run Code Online (Sandbox Code Playgroud)

apache ssl openssl tls1.2

6
推荐指数
1
解决办法
4万
查看次数

如何在按钮单击时显示jQuery Datepicker

我只想在单击按钮时显示日期选择器

<input type="button" id=day value="day" />
$("#day").datepicker();
Run Code Online (Sandbox Code Playgroud)

上面的行用所选日期填充按钮文本

我也尝试过下面的代码,但是什么也没有发生

$("#day").click(function() {
    $("#hiddenField").datepicker('show');
});
Run Code Online (Sandbox Code Playgroud)

jquery jquery-ui

5
推荐指数
2
解决办法
3万
查看次数

排序不在jquery中执行

我正在对div进行排序,但无法执行排序.我正在使用jQuery.fn.sortElements.下面是html.

<div id="sortList">
    <div class="list" style="display: block;">
        <a onclick="openInfoWindow("10"); return false;" href="#"></a>
        <div class="imgClass">
            <a onclick="openInfoWindow("10"); return false;" href="#">
            <img class="innerImg" alt="" src="img">
            </a>
        </div>  
        <div class="inner">
            <div class="name">edata</div>   
        </div>
    </div>

    <div class="list" style="display: block;">
        <a onclick="openInfoWindow("10"); return false;" href="#"></a>  
        <div class="imgClass">
            <a onclick="openInfoWindow("10"); return false;" href="#">
            <img class="innerImg" alt="" src="img">
            </a>
        </div>  
        <div class="inner">
            <div class="name">fdata</div>   
        </div>
    </div>

    <div class="list" style="display: block;">
        <a onclick="openInfoWindow("10"); return false;" href="#"></a>  
        <div class="imgClass">
            <a onclick="openInfoWindow("10"); return false;" href="#">
            <img class="innerImg" alt="" src="img">
            </a> …
Run Code Online (Sandbox Code Playgroud)

javascript jquery

5
推荐指数
1
解决办法
83
查看次数

无法访问 json 对象属性返回未定义

我正在从 json 对象访问一个键,但它返回未定义

{"body":"Hi","date":"2016-07-29 07:43:00"}

var a = JSON.parse(JSON.stringify(r.txt));
console.log(a.body)

//undefined
Run Code Online (Sandbox Code Playgroud)

r 的值是

{
  username: '1',
  txt: '{"body":"Hi","date":"2016-07-29 07:43:00"}',
 }
Run Code Online (Sandbox Code Playgroud)

我曾尝试使用 stringify 然后解析为 json 但仍然返回未定义。

javascript json

5
推荐指数
1
解决办法
7237
查看次数

为 Amazon ApiGateway 中的 URI 指定的 HTTP 终端节点无效

我正在尝试使用 cloudformation 模板为 API 网关创建一个具有 GET 方法的资源 /user/devices 但它给了我一个以下错误

发生错误:ApiGatewayRootMethod - 为 URI 指定的 HTTP 端点无效(服务:AmazonApiGateway;状态代码:400;错误代码:BadRequestException;请求 ID:xxxxxxxxxx)

下面是我的cloudformation模板,

AWSTemplateFormatVersion: 2018-11-13
Description: test user

resources:
  Resources:

    UserDeviceApiGateway:
      Type: "AWS::ApiGateway::RestApi"
      Properties:
        Name: "test-user-info"
        Description: "Fetch the user"

    UserResource:
      Type: 'AWS::ApiGateway::Resource'
      Properties:
        ParentId:
          Fn::GetAtt: ["UserDeviceApiGateway","RootResourceId"]
        RestApiId:
          Ref: "UserDeviceApiGateway"
        PathPart: 'user'

    Resource:
      Type: 'AWS::ApiGateway::Resource'
      Properties:
        ParentId:
          Ref: "UserResource"
        RestApiId:
          Ref: "UserDeviceApiGateway"
        PathPart: 'devices'

    ApiGatewayRootMethod:
      Type: "AWS::ApiGateway::Method"
      Properties:
        AuthorizationType: "NONE"
        HttpMethod: "GET"
        Integration:
          IntegrationHttpMethod: "GET"
          Type: "HTTP"
          Uri: Sub
            - "arn:aws:apigateway:arn:aws:lambda:eu-west-1:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-1:xxxxxxxx:function:user-device-lambda/invocations"
        ResourceId:
          Fn::GetAtt: ["UserDeviceApiGateway","RootResourceId"]
        RestApiId: …
Run Code Online (Sandbox Code Playgroud)

amazon-web-services node.js aws-api-gateway serverless-framework aws-serverless

5
推荐指数
1
解决办法
1万
查看次数

npm ci 给出冲突的对等依赖

我正在尝试使用命令从 docker 文件安装依赖项RUN npm ci。但我收到以下错误Conflicting peer dependencies. Fix the upstream dependency conflict, or retry this command with --force, or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution.。在我的本地项目中,我在运行时克服了这个问题npm install --force。在构建和运行此命令时,如何在 Docker 内部修复此问题RUN npm ci

据我了解,npm ci 会从 package-lock.json 或 npm-shrinkwrap.json 中查找。但仍然面临这个问题。无法弄清楚是什么原因造成的。

node.js npm docker npm-install npm-ci

5
推荐指数
1
解决办法
7581
查看次数