Netlify Lambda构建产生语法错误

时间:2019-06-25 07:53:30

标签: aws-lambda netlify netlify-cli

我正在尝试运行命令npm run build:lambda,但是它一直显示语法错误:

   ****:git user$ npm run build:lambda

    > git@1.0.0 build:lambda /Users/****/git
    > netlify-lambda build functions-active

    netlify-lambda: Building functions
    { [SyntaxError: Expected "'", "'''", "+", "-", "[", "\"", "\"\"\"", "_", "false", "true", "{", [ \t] or [0-9] but "\u201C" found.]
      message:
       'Expected "\'", "\'\'\'", "+", "-", "[", "\\"", "\\"\\"\\"", "_", "false", "true", "{", [ \\t] or [0-9] but "\\u201C" found.',
      expected:
       [ { type: 'literal', value: '\'', description: '"\'"' },
         { type: 'literal', value: '\'\'\'', description: '"\'\'\'"' },
         { type: 'literal', value: '+', description: '"+"' },
         { type: 'literal', value: '-', description: '"-"' },
         { type: 'literal', value: '[', description: '"["' },
         { type: 'literal', value: '"', description: '"\\""' },
         { type: 'literal', value: '"""', description: '"\\"\\"\\""' },
         { type: 'literal', value: '_', description: '"_"' },
         { type: 'literal', value: 'false', description: '"false"' },
         { type: 'literal', value: 'true', description: '"true"' },
         { type: 'literal', value: '{', description: '"{"' },
         { type: 'class', value: '[ \\t]', description: '[ \\t]' },
         { type: 'class', value: '[0-9]', description: '[0-9]' } ],
      found: '“',
      offset: 22,
      line: 2,
      column: 15,
    enter code here` 

我将netlify.toml配置为:

 [build]
  functions = “lambda“

并使用以下命令配置package.json:

   "scripts": {
    "start:lambda": "netlify-lambda serve src/lambda",
    "build:lambda": "netlify-lambda build functions-active"
  },

似乎我缺少一些基本知识,但似乎无法弄清楚什么。有什么帮助吗?谢谢!

1 个答案:

答案 0 :(得分:0)

现在看到我使用了错误的引号,菜鸟错误。...

“ lambda”而不是“ lambda”