expo publish Error spawn /bin/cp ENOENT on windows
Description
Command: expo publish --release-channel myChannel
Expected Behavior
Must publish both android and ios bundles on windows. expo publish is working on IOS.
Observed Behavior
The system cannot find the path specified.
[18:46:48] spawn /bin/cp ENOENT
[18:46:48] Error: spawn /bin/cp ENOENT
at notFoundError (..\expo-cli\node_modules\cross-spawn\lib\enoent.js:11:11)
at verifyENOENT (..s\expo-cli\node_modules\cross-spawn\lib\enoent.js:46:16)
at ChildProcess.cp.emit (...s\expo-cli\node_modules\cross-spawn\lib\enoent.js:33:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
error Command failed with exit code 1.
Environment
Expo CLI 2.7.0 environment info: System: OS: Windows 10 Binaries: Yarn: 1.12.3 - ...\npmrepo\yarn.CMD npm: 6.4.1 -..\nodejs\npm.CMD
Reproducible Demo
"ios": {
"bundleIdentifier": "com.sample",
"buildNumber": "1",
"supportsTablet": true,
"publishBundlePath": "ios/project13/Supporting/shell-app.bundle",
"publishManifestPath": "ios/project13/Supporting/shell-app-manifest.json"
},
"android": {
"package": "com.sample",
"versionCode": 1,
"publishBundlePath": "android\\app\\src\\main\\assets\\shell-app.bundle",
"publishManifestPath": "android\\app\\src\\main\\assets\\shell-app-manifest.json"
},
I've found the error. Please check below code in IosPlist.js.
...npmrepo\node_modules\expo-cli\node_modules\xdl\build\detach\IosPlist.js
// back up old plist and swap in modified one
yield (0, (_ExponentTools || _load_ExponentTools()).spawnAsyncThrowError)('/bin/cp', [configPlistName, `${configPlistName}.bak`]);
also having the same issue
I am also having this issue, has anyone found a solution for it?
My workaround is to use a mac, very annoying when I don't have it available.
@RBrNx comment this line.
yield (0, (_ExponentTools || _load_ExponentTools()).spawnAsyncThrowError)('/bin/cp', [configPlistName, `${configPlistName}.bak`]);
Hi, I have this error on windows , after some research this was the command which gives this error (in my case)
C:\WINDOWS\system32\cmd.exe /d /s /c '"\bin\cp ^"d:\build\git\builds\myapp\ios\myapp\Supporting\EXShell.plist^" ^"d:\build\git\builds\myapp\ios\myapp\Supporting\EXShell.plist.bak^""'
my solution was to copy the bin dir from C:\Program Files\Git\usr\bin
to d: and c:
so the path d:\bin\cp could be resolved
the error was disapeard! :)
hey folks, sorry for this. it looks like the code here was written assuming the cp utility exists, rather than in a cross-platform way that would support windows. for now you can run it in wsl or from git bash to get around the issue, the fix is to update lines like this to use shelljs instead of calling bin/cp directly https://github.com/expo/expo-cli/blob/4e2a1937f45d638962acc8bd4d761c4bc28d3c73/packages/xdl/src/detach/IosPlist.ts#L53
Hey guys, I have been facing the similar issue. So after going through all the above steps, here is what worked for me. I ended up landing at the path \node_modules@expo\xdl\build\detach\IosPlist.js
and had to comment the line
await (0, _ExponentTools().spawnAsyncThrowError)('/bin/cp', [configPlistName, ${configPlistName}.bak]);
My solution was to use a Mac to expo publish
I am on a windows machine and am getting the following error while trying to expo publish an app:
[14:40:04] spawn /bin/cp ENOENT [14:40:04] Error: spawn /bin/cp ENOENT at notFoundError (C:\Users\scott\AppData\Roaming\npm\node_modules\expo-cli\node_modules\cross-spawn\l ib\enoent.js:6:26) at verifyENOENT (C:\Users\scott\AppData\Roaming\npm\node_modules\expo-cli\node_modules\cross-spawn\li b\enoent.js:40:16) at ChildProcess.cp.emit (C:\Users\scott\AppData\Roaming\npm\node_modules\expo-cli\node_modules\cross- spawn\lib\enoent.js:27:25) at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
I tried following some of the comments here to fix it, but no luck. I tried running in git bash etc.
I am also facing same problem when I do expo publish on windows 10
Screenshot: https://imgur.com/u2lfSXJ
this is an issue with expokit, if you are using expokit on windows then please run expo publish through git bash or wsl
Closing as expo publish has been succeeded by eas update.