Bug
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 } }
It looks like this error is happening during the scaffolding process. Can you manually create the files:
cypress/integration/app_spec.js
cypress/plugins/index.js
and export a functioncypress/fixtures/example.json
And then try again?
Also does this happen every time? Or only the first time you install and work with a new project?
I cloned "cypress-example-kitchensink" and received the same error. I haven't been able to run it yet on Windows.
Unfortunately I can't reproduce this in Windows. I've tried all that I can think of.
Is there any way you can give me step-by-step instructions, and include any additional information about your Windows setup. Is it unusual in any way? Is it a VM? What user are you logged into? This almost seems like a permission issue - but I just can't recreate it.
Hopefully something is unusual about the way you're running Cypress. What I'm looking for is something like:
mkdir foo
npm init -y
npm install --save-dev cypress
./node_modules/.bin/cypress open
I have tried adding new projects, and I have tried cloning existing ones. The error is definitely occurring during scaffolding but I don't see why. Does it occur every single time?
This 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:
1) New project: mkdir foo
2) npm init -y
3) npm install --save-dev cypress
4) cd ./node_modules\.bin\
6) cypress open
7) crash.
For step 4, if I do .\node_modules\.bin\cypress open
it 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.
Is there anything that should be changed (code or documentation wise) that I can help with or should I close this issue?
With the same steps, it is not working..
Can't start server
EEXIST: file already exists, mkdir
I am trying to an existing project, that might be a problem let me try a fresh application
This happened to me also....
I will look at this this weekend
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 open
I 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.
I also meet this issue
I'm using window 10 64bit, I saw cypress only support 32 bit, I don't know it's problem
Having exactly the same issue on Windows 10 . Same steps as articulated by aaronherman above.
alternatively had to use the non-NPM desktop app (http://download.cypress.io/desktop) to launch Cypress
I have the same problem with steps above.
Fortunately, I run cypress.
I've created script inside package.json
:
{
"scripts": {
"test": "cypress open"
}
}
Run command:
npm run test
All works fine for me
Didn't work for me as well. I got the same error.
npm init -y
npm install --save-dev cypress
./node_modules/.bin/cypress open
{
"scripts": {
"test": "cypress open"
}
}
into package.json
and run cypress with npm run test
this worked for me ...
C:\_temp\_cypress_windows_test>.\node_modules\.bin\cypress open
as 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_
I had same problem on Windows 10 Pro. I used workaround described by kolasv above and everything seems to be working ok.
How to make run cypress.io on your Windows 10 system.
I had the same issue and i followed the above mentioned steps
{
"scripts": {
"test": "cypress open"
}
}
Run command:
npm run test
and i got the following error:
ENOENT: no such file or directory, open 'C:\Users\<user>\package.json
after that i paste the package.json
file from
C:\Users\<user>\node_modules\cypress\package.json
to
C:\Users\<user>\package.json
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 open
as 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_
I've met the same issue when i type cypress on
in the .bin
folder
C:\Users\xyz\node_modules\ .bin>cypress open
[Not work, Error: EEXIST: file already exists]
It is worked when I using the path as suggested:
C:\Users\xyz>.\node_modules\ .bin\cypress open
[Works well, cool]
That is so weird.
I installed Cypress on the D:\cypress.io
with NPM install cypress
If I'm in the command prompt and attempt to execute cypress from the relative directory
d:\cypress.io\node_modules\.bin>cypress open
I get the EEXIST: file already exists
... Error
However, if I open cypress from a different directory.
d:\cypress.io>.\node_modules\.bin\cypress open
Cypress then executes correctly, in any case ryangz's suggestion worked for me.
That is so weird.
I installed Cypress on theD:\cypress.io
with NPM install cypressIf I'm in the command prompt and attempt to execute cypress from the relative directory
d:\cypress.io\node_modules\.bin>cypress open
I get the EEXIST: file already exists... Error
However, if I open cypress from a different directory.
d:\cypress.io>.\node_modules\.bin\cypress open
Cypress then executes correctly, in any case ryangz's suggestion worked for me.
This is because the command should be executed from the directory that contains the package.json file. Hope this clarifies.
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.json
is located here: https://github.com/cypress-io/cypress-documentation/issues/1364. Our documentation is open source and contributions are welcome. 馃槃
@jennifer-shehane : 'you need to execute the CLI commands from the same directory that your package.json is located ' this solved my problem & worked for me. Thanks!
I have the same problem with steps above.
Fortunately, I run cypress.
I've created script inside package.json:
{
"scripts": {
"test": "cypress open"
}
}
Run command:
npm run test
All works fine for me
This fixed the issue for me thanks @kolasv
This 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:
- New project:
mkdir foo
npm init -y
npm install --save-dev cypress
cd ./node_modules\.bin\
cypress open
- crash.
For step 4, if I do
.\node_modules\.bin\cypress open
it 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 error and after try many things, This last (.node_modules.bincypress open) works for me. I have Windows 10 64 bits installed.
For Windows 7 or other version add this line into package.json
"scripts": {
"test": "cypress open"
},
Now open cmd command and type: npm run test
That works right ! done ...
I had same issue on Windows 10; when i tried to run ./node_modules/.bin/cypress open
in command line I was getting error
". is not recognized as an internal or external command"
. I googled and it appears that this happens because of the environment variable PATH. when i installed nodeJS its path was added to PATH env var but there was no semicolon at the end. I added semicolon and Cypress opened successfully without showing any error. Hope this will be helpful for someone.
I have the same problem. im running windows 10 and [email protected]
I've added the script inside package.json:
"scripts": {
"test": "cypress open"
}
Run command:
npm run test
All works fine for me
This fixed the issue for me thanks @kolasv
I have the same problem with steps above.
Fortunately, I run cypress.
I've created a script inside package.json
:
{
"scripts": {
"test": "cypress open"
}
}
Run command:
npm run test
All works fine for me
this worked for me ...
C:\_temp\_cypress_windows_test>.\node_modules\.bin\cypress open
as 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_
It worked for me.
I got the same issue...
I got the same issue...
Run from the root where you installed Cypress, check the directory separator- On Windows platform use "\" and not "/". Example
c:\cypress>node_modules.bincypress open
This 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:
- New project:
mkdir foo
npm init -y
npm install --save-dev cypress
cd ./node_modules\.bin\
cypress open
- crash.
For step 4, if I do
.\node_modules\.bin\cypress open
it 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.
Really helped
"For step 4, if I do .\node_modules\.bin\cypress open
it 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....
"
Most helpful comment
I have the same problem with steps above.
Fortunately, I run cypress.
I've created script inside
package.json
:Run command:
npm run test
All works fine for me