serverless-chrome: Create failing with ENOENT: no such file or directory

I’m trying to install on Windows, and whether I use cygwin or the native shell I run into this problem trying to create the service:

Jim-PC17 495 ~/workspace/jetsam$ serverless create -u https://github.com/adieuadieu/serverless-chrome/tree/master/examples/serverless-framework/ aws
Serverless: Generating boilerplate...
Serverless: Downloading and installing "examples\serverless-framework\aws"...

  Serverless Error ---------------------------------------

  Error: ENOENT: no such file or directory, link 'C:\Users\Jim\workspace\dist' -> 'C:\cygwin64\tmp\serverless-chrome\packages\lambda\integration-test\dist'

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Forums:        forum.serverless.com
     Chat:          gitter.im/serverless/serverless

  Your Environment Information -----------------------------
     OS:                     win32
     Node Version:           8.9.3
     Serverless Version:     1.24.1

I’m new to this stack, and I’m not sure if that cryptic error message means it can’t make a symlink or can’t find a symlink, or if it’s suggesting I make one. What I have figured out:

  1. C:\Users\Jim\workspace\dist doesn’t exist (and probably shouldn’t be created, as it’s outside the directory I’m trying to install into).
  2. C:\cygwin64\tmp\serverless-chrome\packages\lambda\integration-test does exist but has no dist subdir.
  3. I see in github dist is supposed to be a symlink that points up the tree, but I don’t see its target in github. Maybe it’s supposed to be created during the install? I haven’t figured out how to turn on enough logging to follow the install process.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 12
  • Comments: 16

Most upvoted comments

Any updates on this?

Any workarounds for this? I’ve tried a few things, including:

Run in GitBash as administrator Gives same error as reported by @jkellyinsf

Run in PowerShell as administrator Gives same error as reported by @jkellyinsf

Clone the repo (git@github.com:adieuadieu/serverless-chrome.git) then invoke local version-info as administrator

I had to install chrome-launcher - shouldn’t this be a dev dependency by default?

In any case, once chrome-launcher is installed, I get the following error:

ENOTEMPTY: directory not empty, rmdir ‘~/code/serverless-chrome/examples/serverless-framework/aws/.build/.webpack’

I manually removed the .webpack directory and retried invoking the service locally, but got the same error. Here’s the full output:

$ serverless invoke local -f version-info
Serverless: Injecting Headless Chrome...
Serverless: Bundling with Webpack...
Time: 1848ms
                      Asset    Size  Chunks                    Chunk Names
    src/handlers/version.js  579 kB       0  [emitted]  [big]  src/handlers/version
src/handlers/version.js.map  713 kB       0  [emitted]         src/handlers/version
   [0] external "fs" 42 bytes {0} [not cacheable]
   [1] external "path" 42 bytes {0} [not cacheable]
   [2] ./node_modules/@serverless-chrome/lambda/dist/bundle.es.js 11.5 kB {0} [built]
   [5] external "child_process" 42 bytes {0} [not cacheable]
  [10] external "net" 42 bytes {0} [not cacheable]
  [35] ./.build/src/handlers/version.js 651 bytes {0} [built]
  [36] ./node_modules/chrome-launcher/index.js 412 bytes {0} [optional] [built]
  [37] ./node_modules/chrome-launcher/chrome-launcher.js 25.5 kB {0} [built]
  [47] ./node_modules/chrome-launcher/chrome-finder.js 17.8 kB {0} [built]
  [55] ./node_modules/chrome-launcher/random-port.js 1.92 kB {0} [built]
  [56] ./node_modules/chrome-launcher/flags.js 2.09 kB {0} [built]
  [57] ./.build/src/handlers/1k819a6djhn___version.js 651 bytes {0} [built]
  [58] ./.build/src/handlers/vm9pl8nfv3l___version.js 651 bytes {0} [built]
  [59] ./.build/src/handlers/ueyt7nxxsun___version.js 651 bytes {0} [built]
  [60] ./.build/src/handlers/ojwh36dqtcj___version.js 651 bytes {0} [built]
    + 62 hidden modules

WARNING in ./node_modules/ws/lib/BufferUtil.js
Module not found: Error: Can't resolve 'bufferutil' in '~/code/serverless-chrome/examples/serverless-framework/aws/node_modules/ws/lib'
 @ ./node_modules/ws/lib/BufferUtil.js 35:21-42
 @ ./node_modules/ws/lib/Receiver.js
 @ ./node_modules/ws/index.js
 @ ./node_modules/chrome-remote-interface/lib/chrome.js
 @ ./node_modules/chrome-remote-interface/index.js
 @ ./.build/src/chrome/version.js
 @ ./.build/src/handlers/6kk7p2zprlubqnxa33vkc07ldi___version.js
 @ ./.build/src/handlers/r5h7afteshk___version.js
 @ ./.build/src/handlers/ojwh36dqtcj___version.js
 @ ./.build/src/handlers/ueyt7nxxsun___version.js
 @ ./.build/src/handlers/vm9pl8nfv3l___version.js
 @ ./.build/src/handlers/1k819a6djhn___version.js
 @ ./.build/src/handlers/version.js

WARNING in ./node_modules/ws/lib/Validation.js
Module not found: Error: Can't resolve 'utf-8-validate' in '~/code/serverless-chrome/examples/serverless-framework/aws/node_modules/ws/lib'
 @ ./node_modules/ws/lib/Validation.js 10:22-47
 @ ./node_modules/ws/lib/Receiver.js
 @ ./node_modules/ws/index.js
 @ ./node_modules/chrome-remote-interface/lib/chrome.js
 @ ./node_modules/chrome-remote-interface/index.js
 @ ./.build/src/chrome/version.js
 @ ./.build/src/handlers/6kk7p2zprlubqnxa33vkc07ldi___version.js
 @ ./.build/src/handlers/r5h7afteshk___version.js
 @ ./.build/src/handlers/ojwh36dqtcj___version.js
 @ ./.build/src/handlers/ueyt7nxxsun___version.js
 @ ./.build/src/handlers/vm9pl8nfv3l___version.js
 @ ./.build/src/handlers/1k819a6djhn___version.js
 @ ./.build/src/handlers/version.js
@serverless-chrome/lambda Spawning headless shell

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

  ENOTEMPTY: directory not empty, rmdir '~/code/serverless-chrome/examples/serverless-framework/aws/.build/.webpack'

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

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Forums:        forum.serverless.com
     Chat:          gitter.im/serverless/serverless

  Your Environment Information -----------------------------
     OS:                     win32
     Node Version:           9.3.0
     Serverless Version:     1.25.0

My next step will be to try to rebuild the version-info function from scratch to see if I can spot any issues or get it working.

Any other suggestions for diagnosing/fixing/working-around this issue?

I get the issue on Ubuntu Linux and Windows, here is my error log for Ubuntu Linux running on CodeBuild. Doesn’t happen on my Mac machine 😦

  ENOENT: no such file or directory, link '/codebuild/output/src741193932/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/aperture.direct/backend/.build/functions/puppeteer/XXXXXXX.js' -> '/codebuild/output/src741193932/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/aperture.direct/backend/.build/functions/puppeteer/hbmlz4z2vtw___XXXXXXX.js'
 
     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:                     linux
     Node Version:           8.11.0
     Serverless Version:     1.32.0

Installed Linux, problem has gone.

Still doesn’t work. Maybe I have to migrate to Linux?..