小编Chr*_*itz的帖子

AWS SAM - Esbuild 失败:找不到 esbuild

我正在使用“sam init”尝试使用带有 nodeJS 和 Typescript 的 AWS SAM,但是当我想使用“sam build”构建示例 hello-world-typescript 应用程序时,我收到以下消息:

Building codeuri: C:\RF\GitHub\rf-09-06\hello-world runtime: nodejs14.x metadata: {'BuildMethod': 'esbuild', 'BuildProperties': {'Minify': True, 'Target': 'es2020', 'Sourcemap': True, 'EntryPoints': ['app.ts']}} architecture: x86_64 functions: ['HelloWorldFunction']
Running NodejsNpmEsbuildBuilder:CopySource
Running NodejsNpmEsbuildBuilder:NpmInstall
Running NodejsNpmEsbuildBuilder:EsbuildBundle

Build Failed
Error: NodejsNpmEsbuildBuilder:EsbuildBundle - Esbuild Failed: cannot find esbuild
Run Code Online (Sandbox Code Playgroud)

知道如何解决吗?

谢谢!

typescript aws-sam esbuild

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

将dropzone.js与meteor.js一起使用

我很困惑.我试图使用dropzone.js meteor包(http://atmospherejs.com/dbarrett/dropzonejs)与我的流星应用程序,但我找不到任何关于它的例子.在文档中它说:使用这样的模板

{{> dropzone url='http://somewebsite.com/upload' id='dropzoneDiv'}}
Run Code Online (Sandbox Code Playgroud)

和

它会将任何上传的文件发布到您选择的网址上.

所以,如果我写,

{{> dropzone url='http://localhost:3000/home' id='dropzoneDiv'}}
Run Code Online (Sandbox Code Playgroud)

一旦我删除图像,它是否会将其上传到/ public/home文件夹?我的意思是包处理服务器端保存图像呢?如果没有,你能否给我一些关于如何处理服务器端保存的提示?

谢谢

meteor dropzone.js

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

在流星应用程序中查找所有资产的最佳方法是什么?

我知道可以只读取program.json文件,它列出了所有资产:https: //github.com/meteor/meteor/issues/1328#issuecomment-22913769

但这种感觉错了,我无法确定这是否会得到支持.关于资产本身的文档在这方面仍然有点稀疏(http://docs.meteor.com/#assets).

有关如何列出所有资产的最佳做法吗?

meteor

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

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

使用graphicsmagick在collectionFS中出现意外的空写入流

我正在使用CollectionFS来管理图像.此外,我正在使用graphicsmagick gm()来处理图像.

现在我想要裁剪已保存的图像.因此,在单击事件上调用服务器方法,该方法执行crop().但是在这样做之后,我在集合中找到了一个size=0在正确日期更新的空图像.

我没有看到,我做错了什么.

shared.js

Images = new FS.Collection("images", {
    stores: [
        new FS.Store.FileSystem("thumbnail", { 
            transformWrite: function(fileObj, readStream, writeStream) {
                gm(readStream, fileObj.name()).autoOrient().resize('96', '96' + '^').gravity('Center').extent('96', '96').stream().pipe(writeStream);
            } 
        }),
        new FS.Store.FileSystem("public"),
    ]
});
Run Code Online (Sandbox Code Playgroud)

server.js

Meteor.methods({
    'crop': function (fileId, selection) {
        var file = Images.findOne({ _id: fileId }),
            read = file.createReadStream('public'),
            write = file.createWriteStream('public');

        gm(read)
            .crop(selection.width, selection.height, selection.left, selection.top)
        .stream()
        .pipe(write);
    }
});
Run Code Online (Sandbox Code Playgroud)

client.js

Template.editor.events({
    'click #crop': function () { 
        var fileId      = '123456789',
            selection   = { height: 100, …
Run Code Online (Sandbox Code Playgroud)

javascript graphicsmagick meteor collectionfs

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

alpine ctypes loadlibrary() 上的 python 失败并出现 OSError: 重新定位 ./cc.so: 时出错: : 初始执行 TLS 解析为 ./cc.so 中的动态定义

我致力于在基于 alpine 的容器上使用 golang 在 python 脚本(ctypes loadlibrary)中构建共享库。

但失败如下,

/usr/src/app # **go build -o cc.so -buildmode=c-shared main.go**

/usr/src/app # **readelf -d cc.so**

Dynamic section at offset 0x10cd10 contains 22 entries: Tag Type
Name/Value 0x0000000000000001 (NEEDED) Shared library:
[libc.musl-x86_64.so.1] 0x0000000000000010 (SYMBOLIC) 0x0
0x000000000000000c (INIT) 0x42000 0x000000000000000d (FINI) 0x92ed9
0x0000000000000019 (INIT_ARRAY) 0xa2078 0x000000000000001b
(INIT_ARRAYSZ) 8 (bytes) 0x000000006ffffef5 (GNU_HASH) 0x270
0x0000000000000005 (STRTAB) 0xa50 0x0000000000000006 (SYMTAB) 0x378
0x000000000000000a (STRSZ) 1026 (bytes) 0x000000000000000b (SYMENT) 24
(bytes) 0x0000000000000003 (PLTGOT) 0x10deb0 0x0000000000000002
(PLTRELSZ) 720 (bytes) 0x0000000000000014 (PLTREL) …
Run Code Online (Sandbox Code Playgroud)

python go docker alpine-linux

5
推荐指数
0
解决办法
1000
查看次数

Reactjs - 使用 oneOfType 检查 proptypes

我想允许组件具有两种可能的属性类型之一(字符串或未定义)。我正在使用 PropTypes.oneOfType 来执行此操作。

import React from 'react';
import PropTypes from 'prop-types';

Product.propTypes = {
    productTag: PropTypes.oneOfType([
        PropTypes.string, undefined
    ]),
};

Product.defaultProps = {
    productTag: undefined
};
Run Code Online (Sandbox Code Playgroud)

这是正确的方法吗?

reactjs react-proptypes

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

为什么我不能在 React 中使用 jsonwebtoken 中的 jwt.verify() ?

当我在react中使用jwt.verify()或jwt.decode()函数时,它显示了很多错误。

错误是:

ERROR in ./node_modules/jwa/index.js 5:13-30

Module not found: Error: Can't resolve 'crypto' in 'C:\Users\client\node_modules\jwa'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
    - add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
    - install 'crypto-browserify'
If you don't want to include a polyfill, you can …
Run Code Online (Sandbox Code Playgroud)

javascript node.js npm jwt webpack

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

运行流星时出现“证书已过期”错误

   While downloading accounts-base@1.2.11...:
   error: certificate has expired

   While downloading accounts-password@1.3.0...:
   error: certificate has expired

   While downloading alanning:roles@1.2.15...:
   error: certificate has expired

   While downloading aldeed:collection2@2.10.0...:
   error: certificate has expired

   While downloading aldeed:collection2-core@1.2.0...:
   error: certificate has expired

   While downloading aldeed:schema-deny@1.1.0...:
Run Code Online (Sandbox Code Playgroud)

甚至尝试设置 NODE_TLS_REJECT_UNAUTHORIZED=0 然后运行meteor。但仍然出现错误。

meteor meteor-blaze meteor-accounts visual-studio-code angular-meteor

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

用于mongo地理位置数据的Meteor简单模式

我想为我的meteor app创建一个管理表单; 在尝试从头构建一个之前我打算尝试Ogno Admin,但我不确定它是否能够以我需要的格式支持数据.我当前的应用数据会像这样进入mongo:

Beaches.insert({
    "name": "Entry name",
    /* location stored like this so I can use mongo $near queries */
    "location": {
        "type": "Point",
        "coordinates": [-5.0990296,50.110757]
    },
    /* could be many images, minimum 1 */
    "images": [
        {
            "url": "image1.jpg",
            "caption": "Image caption"
        }
    ],
    "shortDesc": "A delightful description...",
    /* fixed list of attributes stored as objects */
    "attributes": {
        "attr 1": {
            "score": 2,
            "text": "attr1 text"
        },
Run Code Online (Sandbox Code Playgroud)

我可以编写一个简单的模式来支持上面的不同数组/对象(尤其是位置坐标)吗?它们必须是方括号格式[lng,lat] - 并且ogno管理员可以使用它,还是我必须编写自定义管理员的东西?我可能更容易在其他东西中构建管理站点并获得它来为Meteor输出JSON数据.

更新可能的架构代码

Beaches = new SimpleSchema({
  name: { …
Run Code Online (Sandbox Code Playgroud)

schema mongodb meteor

4
推荐指数
2
解决办法
2690
查看次数