尝试部署到aws-lambda时出错:不允许的操作发生

时间:2019-08-08 11:29:24

标签: amazon-web-services aws-lambda puppeteer serverless-framework

我正在尝试向aws部署一个函数,以获取给定URL的屏幕快照并进行推文操作。我正在使用puppeteer-core,@ serverless-chrome / lambda和serverless-plugin-chrome来获取这些文章之后的屏幕截图(但是而不是上传到aws,我会发布图像):https://swizec.com/blog/serverless-chrome-on-aws-lambda-the-guide-works-in-2019-beyond/swizec/9024https://nadeesha.github.io/headless-chrome-puppeteer-lambda-servelerless/

它在本地调用时可以正常工作,并且可以执行所有操作,但是当我尝试部署它时,会显示“不允许操作”错误。下面是我尝试部署时的控制台日志。

Serverless: Injecting Headless Chrome...

  Error --------------------------------------------------

  EPERM: operation not permitted, symlink 'C:\Users\xx\yy\zz\node_modules' -> 'C:\Users\xx\yy\zz\.build\node_modules'

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     OS:                     win32
     Node Version:           8.10.0
     Serverless Version:     1.45.1

最初,我尝试仅使用puppeteer,但程序包太大,因此我决定采用这种无服务器镶边方法,这是一个相关链接,但我无法解决它https://github.com/adieuadieu/serverless-chrome/issues/155

1 个答案:

答案 0 :(得分:0)

尝试在部署之前删除.build文件夹。