0

I'm trying to get some simple Puppeteer tests runnin on my Windows 10 machine.

I'm running Java 8, Node v11.12.0 and ECMAScript6.

The examples I've pulled are from this repo: https://github.com/checkly/puppeteer-examples

This provides the following package.json:

{
 "name": "puppeteer-examples",
  "version": "1.0.0",
  "description": "",
  "dependencies": {
    "puppeteer": "^1.20.0"
  },
  "devDependencies": {
    "eslint-plugin-mocha": "^4.11.0",
    "file-system": "^2.2.2",
    "jest": "^21.2.1",
    "js-comments": "^0.5.4",
    "lodash": "^4.17.15"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/checkly/puppeteer- 
   examples.git"
   },
  "author": "Tim Nolet",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/checkly/puppeteer- 
  examples/issues"
  },
     "homepage": "https://github.com/checkly/puppeteer- 
      examples#readme"
}

I have run npm install

With any example I try to run, the following errors are yielded:

C:\functional_tests\puppeteer-examples\1. basics>node forms.js
(node:5708) UnhandledPromiseRejectionWarning: Error: spawn EPERM
    at ChildProcess.spawn (internal/child_process.js:372:11)
    at Object.spawn (child_process.js:559:9)
    at Launcher.launch (C:\functional_tests\puppeteer-examples\node_modules\puppeteer\lib\Launcher.js:132:40)
(node:5708) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by r
ejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:5708) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js proce
ss with a non-zero exit code.

I am a Javascript novice!

Any clues as to what's going on most welcome

Thanks

Steerpike
  • 1,245
  • 3
  • 25
  • 50
  • I think this is alread answer here: https://stackoverflow.com/questions/34600932/npm-eperm-operation-not-permitted-on-windows – lcrespilho Sep 13 '19 at 20:47
  • @lcrespilho thanks, I have tried literally everything suggested on that thread and still no joy. This is driving me nuts. – Steerpike Sep 16 '19 at 09:35
  • And what happens if you try a more basic test? Have you tried the first example of https://pptr.dev/ ? Basicly, do this things: (1) create a directory and cd into it; (2) run "npm init -y"; (3) run "npm i puppeteer"; (4) run "node example.js", where example.js is the first example of https://pptr.dev/: the one that goes to example.com and take a screenshot. The result is the same EPERM errors? Try also to use directories without "spaces" on the name. Another think to try is change the directory permissions on windows giving permissions for everybody (don't know how to do it on windows). :) – lcrespilho Sep 16 '19 at 11:32
  • @Icrespilho thanks for the suggestions - much appreciated. I think the issue is with Sophos blocking the spawning of Chrome/Chromium. I know have it working wherever I have the path the my local Chrome hardcoded in – Steerpike Sep 16 '19 at 13:34

0 Answers0