cypress: EEXIST: file already exists - cannot start server on Windows
Is this a Feature or Bug?
Bug
Current behavior:
When installing and running Cypress on Windows, I get the following error:
Error: EEXIST: file already exists, mkdir 'C:\Users\aaron\Roaming\node_modules\.bin\cypress
This has been duplicated on both Windows 7 and Windows 10.
Debug output
Wed, 20 Dec 2017 02:09:32 GMT cypress:ts Running without ts-node hook in environment "production"
Wed, 20 Dec 2017 02:09:33 GMT cypress:server:appdata path: C:\Users\aaron\AppData\tmp\Cypress\cy\production
Wed, 20 Dec 2017 02:09:33 GMT cypress:server starting cypress server
Wed, 20 Dec 2017 02:09:33 GMT cypress:server:appdata path: C:\Users\aaron\AppData\tmp\Cypress\cy\production
Wed, 20 Dec 2017 02:09:37 GMT cypress:server start in mode headed with options {"_":["C:\\Users\\aaron\\tmp\\node_modules\\cypress\\dist\\Cypress\\Cypress.exe"],"project":"C:\\Users\\aaron\\tmp\\node_modules\\.bin","projectPath":"C:\\Users\\aaron\\tmp\\node_modules\\.bin"}
Wed, 20 Dec 2017 02:09:43 GMT cypress:server:appdata path: C:\Users\aaron\AppData\tmp\Cypress\cy\production\browsers
Wed, 20 Dec 2017 02:09:44 GMT cypress:server:appdata path: C:\Users\aaron\AppData\tmp\Cypress\cy\production\cache
Wed, 20 Dec 2017 02:10:00 GMT cypress:server:timers queuing timer id 1 after 500 ms
Wed, 20 Dec 2017 02:10:00 GMT cypress:server:timers child received timer id 1
Wed, 20 Dec 2017 02:10:00 GMT cypress:server:timers child sending timer id 1
Wed, 20 Dec 2017 02:10:00 GMT cypress:server:timers clearing timer id 1 from queue { '1': { args: [], ms: 500, cb: [Function] } }
Wed, 20 Dec 2017 02:10:00 GMT cypress:server making saved state from C:\Users\aaron\tmp\node_modules\cypress\dist\Cypress\resources\app\packages\server
Wed, 20 Dec 2017 02:10:00 GMT cypress:server for project path C:\Users\aaron\tmp\node_modules\.bin
Wed, 20 Dec 2017 02:10:00 GMT cypress:server state path for project C:\Users\aaron\tmp\node_modules\.bin
Wed, 20 Dec 2017 02:10:00 GMT cypress:server:appdata path: C:\Users\aaron\AppData\tmp\Cypress\cy\production\projects\.bin-51b4388fba0de7ac28bff8df9045a210\state.json
Wed, 20 Dec 2017 02:10:00 GMT cypress:server full state path C:\Users\aaron\AppData\tmp\Cypress\cy\production\projects\.bin-51b4388fba0de7ac28bff8df9045a210\state.json
Wed, 20 Dec 2017 02:10:00 GMT cypress:server making new state file around C:\Users\aaron\AppData\tmp\Cypress\cy\production\projects\.bin-51b4388fba0de7ac28bff8df9045a210\state.json
Wed, 20 Dec 2017 02:10:00 GMT cypress:server:file reading JSON file C:\Users\aaron\AppData\tmp\Cypress\cy\production\projects\.bin-51b4388fba0de7ac28bff8df9045a210\state.json
Wed, 20 Dec 2017 02:10:00 GMT cypress:server:windows creating electron window with options { backgroundColor: '#dfe2e4', width: 800, height: 550, minWidth: 458, minHeight: 400, x: null, y: null, type: 'INDEX', devTools: false, trackState: { width: 'appWidth', height: 'appHeight', x: 'appX', y: 'appY', devTools: 'isAppDevToolsOpen' }, onBlur: [Function: onBlur], onFocus: [Function: onFocus], onClose: [Function: onClose], show: true, url: 'file://C:\\Users\\aaron\\tmp\\node_modules\\cypress\\dist\\Cypress\\resources\\app\\packages\\desktop-gui\\dist\\index.html', webPreferences: { preload: 'C:\\Users\\aaron\\tmp\\node_modules\\cypress\\dist\\Cypress\\resources\\app\\packages\\server\\lib\\ipc\\ipc.js', chromeWebSecurity: true, nodeIntegration: false, backgroundThrottling: false, backgroundColor: '#dfe2e4' }, frame: true, contextMenu: false, recordFrameRate: null, onPaint: null, onCrashed: [Function: onCrashed], onNewWindow: [Function: onNewWindow] }
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:events got request for event: on:menu:clicked undefined
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:events got request for event: get:options undefined
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:events sending ipc data { type: 'get:options',
data:
{ id: 0.6289514760541144,
data:
{ _: [Object],
project: 'C:\\Users\\aaron\\tmp\\node_modules\\.bin',
projectPath: 'C:\\Users\\aaron\\tmp\\node_modules\\.bin',
onFocusTests: [Function: onFocusTests],
os: 'win32',
version: '1.4.0' } } }
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:events got request for event: get:current:user undefined
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:file reading JSON file C:\Users\aaron\AppData\tmp\Cypress\cy\production\cache
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:events sending ipc data { type: 'get:current:user',
data: { id: 0.3762137311755782, data: {} } }
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:events got request for event: on:focus:tests undefined
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:events got request for event: on:spec:changed undefined
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:events got request for event: on:config:changed undefined
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:events got request for event: on:project:error undefined
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:events got request for event: on:project:warning undefined
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:events got request for event: open:project C:\Users\aaron\tmp\node_modules\.bin
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:project Project created C:\Users\aaron\tmp\node_modules\.bin
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:events got request for event: updater:check undefined
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:updater checking for new version of Cypress. current version is 1.4.0
Wed, 20 Dec 2017 02:10:02 GMT cypress:launcher checking one browser chrome
Wed, 20 Dec 2017 02:10:02 GMT cypress:launcher looking up chrome on win32 platform
Wed, 20 Dec 2017 02:10:02 GMT cypress:launcher exe path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
Wed, 20 Dec 2017 02:10:02 GMT cypress:launcher found C:\Program Files (x86)\Google\Chrome\Application\chrome.exe ? true
Wed, 20 Dec 2017 02:10:02 GMT cypress:launcher Version=63.0.3239.84
Wed, 20 Dec 2017 02:10:02 GMT cypress:launcher browser chrome at 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe' version 63.0.3239.84
Wed, 20 Dec 2017 02:10:02 GMT cypress:launcher setting major version for {"name":"chrome","displayName":"Chrome","version":"63.0.3239.84","path":"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"}
Wed, 20 Dec 2017 02:10:02 GMT cypress:launcher browser chrome version 63.0.3239.84 major version 63
Wed, 20 Dec 2017 02:10:02 GMT cypress:launcher checking one browser chromium
Wed, 20 Dec 2017 02:10:02 GMT cypress:launcher looking up chromium on win32 platform
Wed, 20 Dec 2017 02:10:02 GMT cypress:launcher exe path C:\Program Files (x86)\Google\chrome-win32\chrome.exe
Wed, 20 Dec 2017 02:10:02 GMT cypress:launcher found C:\Program Files (x86)\Google\chrome-win32\chrome.exe ? false
Wed, 20 Dec 2017 02:10:02 GMT cypress:launcher browser chromium not installed
Wed, 20 Dec 2017 02:10:02 GMT cypress:launcher checking one browser canary
Wed, 20 Dec 2017 02:10:02 GMT cypress:launcher looking up canary on win32 platform
Wed, 20 Dec 2017 02:10:02 GMT cypress:launcher exe path C:\Users\aaron\AppData\Local\Google\Chrome SxS\Application\chrome.exe
Wed, 20 Dec 2017 02:10:02 GMT cypress:launcher found C:\Users\aaron\AppData\Local\Google\Chrome SxS\Application\chrome.exe ? false
Wed, 20 Dec 2017 02:10:02 GMT cypress:launcher browser canary not installed
Wed, 20 Dec 2017 02:10:02 GMT cypress:server opening project C:\Users\aaron\tmp\node_modules\.bin
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:project opening project instance C:\Users\aaron\tmp\node_modules\.bin
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:config setting support file C:\Users\aaron\tmp\node_modules\.bin\cypress\support
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:config for project root C:\Users\aaron\tmp\node_modules\.bin
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:config support file C:\Users\aaron\tmp\node_modules\.bin\cypress\support does not exist
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:config support file is default, check if C:\Users\aaron\tmp\node_modules\.bin\cypress exists
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:config support folder does not exist, set to default index.js
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:config set support folder C:\Users\aaron\tmp\node_modules\.bin\cypress\support
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:config setting plugins file C:\Users\aaron\tmp\node_modules\.bin\cypress\plugins
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:config for project root C:\Users\aaron\tmp\node_modules\.bin
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:config plugins file does not exist
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:config plugins file is default, check if C:\Users\aaron\tmp\node_modules\.bin\cypress exists
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:config plugins folder does not exist, set to default index.js
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:scaffold scaffolded files ["cypress\\integration\\example_spec.js","cypress\\fixtures\\example.json","cypress\\support\\commands.js","cypress\\support\\index.js","cypress\\plugins\\index.js"]
Wed, 20 Dec 2017 02:10:02 GMT cypress:server making saved state from C:\Users\aaron\tmp\node_modules\cypress\dist\Cypress\resources\app\packages\server
Wed, 20 Dec 2017 02:10:02 GMT cypress:server for project path C:\Users\aaron\tmp\node_modules\.bin
Wed, 20 Dec 2017 02:10:02 GMT cypress:server state path for project C:\Users\aaron\tmp\node_modules\.bin
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:appdata path: C:\Users\aaron\AppData\tmp\Cypress\cy\production\projects\.bin-51b4388fba0de7ac28bff8df9045a210\state.json
Wed, 20 Dec 2017 02:10:02 GMT cypress:server full state path C:\Users\aaron\AppData\tmp\Cypress\cy\production\projects\.bin-51b4388fba0de7ac28bff8df9045a210\state.json
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:file reading JSON file C:\Users\aaron\AppData\tmp\Cypress\cy\production\projects\.bin-51b4388fba0de7ac28bff8df9045a210\state.json
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:scaffold found 0 files in folder C:\Users\aaron\tmp\node_modules\.bin\cypress\integration
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:scaffold untouched scaffold true modal closed false
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:scaffold plugins folder C:\Users\aaron\tmp\node_modules\.bin\cypress\plugins
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:scaffold verify scaffolding in C:\Users\aaron\tmp\node_modules\.bin\cypress\plugins
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:scaffold missing folder C:\Users\aaron\tmp\node_modules\.bin\cypress\plugins
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:scaffold copying index.js into C:\Users\aaron\tmp\node_modules\.bin\cypress\plugins
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:scaffold scaffolded files ["cypress\\integration\\example_spec.js","cypress\\fixtures\\example.json","cypress\\support\\commands.js","cypress\\support\\index.js","cypress\\plugins\\index.js"]
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:events send error: { Error: EEXIST: file already exists, mkdir 'C:\Users\aaron\tmp\node_modules\.bin\cypress'
at Error (native)
cause:
{ Error: EEXIST: file already exists, mkdir 'C:\Users\aaron\tmp\node_modules\.bin\cypress'
at Error (native)
errno: -4075,
code: 'EEXIST',
syscall: 'mkdir',
path: 'C:\\Users\\aaron\\tmp\\node_modules\\.bin\\cypress' },
isOperational: true,
errno: -4075,
code: 'EEXIST',
syscall: 'mkdir',
path: 'C:\\Users\\aaron\\tmp\\node_modules\\.bin\\cypress' }
Wed, 20 Dec 2017 02:10:02 GMT cypress:server:events sending ipc data { type: 'open:project',
data:
{ id: 0.4466535685737474,
__error:
{ name: 'Error',
stack: 'Error: EEXIST: file already exists, mkdir \'C:\\Users\\aaron\\tmp\\node_modules\\.bin\\cypress\'\n at Error (native)\n',
message: 'EEXIST: file already exists, mkdir \'C:\\Users\\aaron\\tmp\\node_modules\\.bin\\cypress\'',
cause: [Object],
isOperational: true,
errno: -4075,
code: 'EEXIST',
syscall: 'mkdir',
path: 'C:\\Users\\aaron\\tmp\\node_modules\\.bin\\cypress' } } }
Wed, 20 Dec 2017 02:10:03 GMT cypress:server:updater latest version of Cypress is: 1.4.0
Wed, 20 Dec 2017 02:10:03 GMT cypress:server:updater new version of Cypress does not exist
Wed, 20 Dec 2017 02:10:03 GMT cypress:server:events sending ipc data { type: 'updater:check',
data: { id: 0.786888422730067, data: false } }
- Operating System: Windows 7 & 10
- Cypress Version: 1.0.3 & 1.3.0
- Browser Version: Chrome 63
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 41 (6 by maintainers)
I have the same problem with steps above. Fortunately, I run cypress. I’ve created script inside
package.json:Run command:
npm run testAll works fine for me
How to make run cypress.io on your Windows 10 system.
Didn’t work for me as well. I got the same error.
npm init -ynpm install --save-dev cypress./node_modules/.bin/cypress openAnd boom the error. Thanks to @kolasv I’ve workaround it by adding:into
package.jsonand run cypress withnpm run testThis is a local account and is an administrator for the computer. I have UAC on the recommended setting, not sure if that’s causing anything. It does happen every single time I open it. Same with a co-worker on Windows 7.
Are you running this on CMD?
This is what I do:
mkdir foonpm init -ynpm install --save-dev cypresscd ./node_modules\.bin\cypress openFor step 4, if I do
.\node_modules\.bin\cypress openit works. I just tried it now for the first time. The reason I was CD’ing into the directory is because I was getting'.' is not a recognized internal or external command....Can you try to replicate and see if doing it the way I had it will break it.
I had the same issue and i followed the above mentioned steps
Run command:
npm run testand i got the following error:
after that i paste the
package.jsonfile fromto
and that worked for me.
@padmarajnidagundi i followed the steps you mentioned and it’s working for me
this worked for me …
C:\_temp\_cypress_windows_test>.\node_modules\.bin\cypress openas mentioned above, you have to be in the correct directory first.
Cypress package version: 2.0.3 Windows 10 Pro Node v6.11.0 Npm 3.10.10
Okay, Forget about me. I did not follow the instructions properly. I was in the wrong folder once I typed in
.\node_modules\.bin\cypress openI got past that. I was in the wrong folder last time… Are there instructions out there that are not gif. I tried to pause it, but of course that did not work. Also thanks for doing this, I might throw protractor out if this works for me.Hopefully, It will work for you
Start a brand new project like mkdir Some npm init -y npm install --save-dev cypress ./node_modules/.bin/cypress open After opening the cypress dialog with error, Just delete the already existing file “Cypress” from ./node_modules/.bin/
After I deleted the file it is work for me. Thanks
This helped me. You have to be in the root directory of the project and then enter: .\node_modules.bin\cypress open
I first navigated to .\bin and typed cypress open, which didn’t work.
I created a new issue in our docs to document that you need to execute the CLI commands from the same directory that your
package.jsonis located here: https://github.com/cypress-io/cypress-documentation/issues/1364. Our documentation is open source and contributions are welcome. 😄This is because the command should be executed from the directory that contains the package.json file. Hope this clarifies.
I’ve met the same issue when i type
cypress onin the.binfolderIt is worked when I using the path as suggested: