0

Trying to convert my existing puppeteer test to playwright. The instruction here is not very clear. Has anyone able to do this successfully? What steps did you follow?

https://github.com/checkly/puppeteer-to-playwright#-getting-started

downloaded the repo. Tried running npm run convert -- -d my-puppeteer-script.js (changed test file name to cookies.js. I get this:

puppeteer-to-playwright@1.0.0 convert
> jscodeshift --run-in-band "-d" "cookies.js"

Skipping path cookies.js which does not exist. 
No files selected, nothing to do. 
All done. 
Results: 
0 errors
0 unmodified
0 skipped
0 ok
Time elapsed: 0.002seconds 
Tgebrehiwot4@C02FL3CBMD6R puppeteer-to-playwright % npm install -g jscodeshift
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/jscodeshift
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/jscodeshift'
npm ERR!  [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/jscodeshift'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/usr/local/lib/node_modules/jscodeshift'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Tgebrehiwot4/.npm/_logs/2022-10-27T17_55_03_898Z-debug-0.log
Tgebrehiwot4@C02FL3CBMD6R puppeteer-to-playwright % 
theDavidBarton
  • 7,643
  • 4
  • 24
  • 51

1 Answers1

1
[Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/jscodeshift']

This is a permission error, you need to check the folder/file permissions to ensure you have the necessary permissions to perform the actions it needs.

This question can help you how to change the permissions for a specific folder on Linux.

Rafael Amaral
  • 36
  • 1
  • 4