I have been trying to start playing with playwright, and after I create a file and type in traminal.
npm init playwright@latest
type hopopa@C10953 tau-playwright % npm init playwright
Getting started with writing end-to-end tests with Playwright:
Initializing project in '.'
✔ Do you want to use TypeScript or JavaScript? · JavaScript
✔ Where to put your end-to-end tests? · tests
✔ Add a GitHub Actions workflow? (y/N) · false
✔ Install Playwright browsers (can be done manually via 'npx playwright install')? (Y/n) · true
Initializing NPM project (npm init -y)…
Wrote to /Users/opopa/Downloads/tau-playwright/package.json:
{
"name": "tau-playwright",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
Installing Playwright Test (npm install --save-dev @playwright/test)…
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path /Users/opopa/.npm/_cacache/tmp/8b552901
npm ERR! dest /Users/opopa/.npm/_cacache/content-v2/sha512/c9/bc/7df5c2d38454f98c5911130ebe88264cc64674efb9e419969ffd3f91f65d6a2e9153945d5f74115e1930b108767049336fbec9f634572b66649eac1a0f19
npm ERR! errno ENOENT
npm ERR! enoent Invalid response body while trying to fetch https://registry.npmjs.org/@playwright%2ftest: ENOENT: no such file or directory, rename '/Users/opopa/.npm/_cacache/tmp/8b552901' -> '/Users/opopa/.npm/_cacache/content-v2/sha512/c9/bc/7df5c2d38454f98c5911130ebe88264cc64674efb9e419969ffd3f91f65d6a2e9153945d5f74115e1930b108767049336fbec9f634572b66649eac1a0f19'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/opopa/.npm/_logs/2023-03-09T23_44_52_617Z-debug-0.log
Error: Command failed: npm install --save-dev @playwright/test
at checkExecSyncError (node:child_process:885:11)
at execSync (node:child_process:957:15)
at executeCommands (/Users/opopa/.npm/_npx/486fe028cf2e825e/node_modules/create-playwright/lib/index.js:4519:39)
at Generator.run (/Users/opopa/.npm/_npx/486fe028cf2e825e/node_modules/create-playwright/lib/index.js:4670:5)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /Users/opopa/.npm/_npx/486fe028cf2e825e/node_modules/create-playwright/lib/index.js:4938:3 {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 1566,
stdout: null,
stderr: null
}
npm ERR! code 1
npm ERR! path /Users/opopa/Downloads/tau-playwright
npm ERR! command failed
npm ERR! command sh -c create-playwright
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/opopa/.npm/_logs/2023-03-09T23_44_42_377Z-debug-0.logere
If I type the same command with sudo it works. BUT after I try to do anything like. create a folder in VS Code, ore even save what code i wrote, i have a perrmision error.
Unable to write file '/Users/opopa/Downloads/tau-playwright/tests/trello.spec.js' (NoPermissions (FileSystemError): Error: EACCES: permission denied, open '/Users/opopa/Downloads/tau-playwright/tests/trello.spec.js')
All the folders have read/write permissions, I think is a problem with playwright.
Can you please help me?
I first tried to delete vs code and installed it back, I checked the permissions of VS Code, but the problem is not with the VS code because if i try to save a normal html/ js/ py file it works. When I use playwright has a problem.