expo-cli icon indicating copy to clipboard operation
expo-cli copied to clipboard

expo publish Error spawn /bin/cp ENOENT on windows

Open onka13 opened this issue 7 years ago • 12 comments

Jump to the solution


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`]);

onka13 avatar Jan 25 '19 16:01 onka13

also having the same issue

klanmiko avatar Mar 17 '19 06:03 klanmiko

I am also having this issue, has anyone found a solution for it?

RBrNx avatar May 10 '19 14:05 RBrNx

My workaround is to use a mac, very annoying when I don't have it available.

Foosballfan avatar May 10 '19 14:05 Foosballfan

@RBrNx comment this line.

yield (0, (_ExponentTools || _load_ExponentTools()).spawnAsyncThrowError)('/bin/cp', [configPlistName, `${configPlistName}.bak`]);

onka13 avatar May 10 '19 20:05 onka13

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! :)

EKoetsjarjan avatar Nov 06 '19 09:11 EKoetsjarjan

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

brentvatne avatar Dec 07 '19 03:12 brentvatne

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]);

sweetsamy21 avatar Dec 08 '19 21:12 sweetsamy21

My solution was to use a Mac to expo publish

jsam6 avatar Dec 27 '19 02:12 jsam6

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.

scottgreene88 avatar Feb 12 '20 22:02 scottgreene88

I am also facing same problem when I do expo publish on windows 10

Screenshot: https://imgur.com/u2lfSXJ

aditodkar avatar Feb 25 '20 12:02 aditodkar

this is an issue with expokit, if you are using expokit on windows then please run expo publish through git bash or wsl

brentvatne avatar Mar 06 '20 20:03 brentvatne

Closing as expo publish has been succeeded by eas update.

EvanBacon avatar Oct 27 '22 01:10 EvanBacon