Reputation: 370
I've been having some trouble to start this react native app using expo. I couldn't install expo-cli
using npm so I decided to use Yarn. After some errors with yarn it finally worked out, but now I can't add any package to the project using expo install
.
Here is the command that I ran:
expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view
from react-navigation tutorial
but I'm getting the following output:
yarn add v1.22.4
[1/4] Resolving packages...
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this comm
and.
yarnpkg exited with non-zero code: 1
Error: yarnpkg exited with non-zero code: 1
at ChildProcess.completionListener (/usr/local/share/.config/yarn/global/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
at Object.onceWrapper (events.js:418:26)
at ChildProcess.emit (events.js:311:20)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
...
at Object.spawnAsync [as default] (/usr/local/share/.config/yarn/global/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
at YarnPackageManager.<anonymous> (/usr/local/share/.config/yarn/global/node_modules/@expo/package-manager/src/PackageManager.ts:208:31)
at Generator.next (<anonymous>)
at /usr/local/share/.config/yarn/global/node_modules/@expo/package-manager/build/PackageManager.js:8:71
at new Promise (<anonymous>)
at __awaiter (/usr/local/share/.config/yarn/global/node_modules/@expo/package-manager/build/PackageManager.js:4:12)
at YarnPackageManager._runAsync (/usr/local/share/.config/yarn/global/node_modules/@expo/package-manager/build/PackageManager.js:194:16)
at YarnPackageManager.<anonymous> (/usr/local/share/.config/yarn/global/node_modules/@expo/package-manager/src/PackageManager.ts:189:16)
at Generator.next (<anonymous>)
at /usr/local/share/.config/yarn/global/node_modules/@expo/package-manager/build/PackageManager.js:8:71
yarn-error.log (First lines):
Arguments:
/snap/node/2609/bin/node /usr/share/yarn/bin/yarn.js add react-native-gesture-handler@~1.6.0 react-native-reanimated@~1.7.0 react-native-screens@~2.2.0 [email protected] @react-native-community/[email protected]
PATH:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
Yarn version:
1.22.4
Node version:
12.16.1
Platform:
linux x64
Trace:
Error: EACCES: permission denied, write
at writeSync (fs.js:598:3)
at SyncWriteStream._write (internal/fs/sync_write_stream.js:24:3)
at doWrite (_stream_writable.js:441:12)
at writeOrBuffer (_stream_writable.js:425:5)
at SyncWriteStream.Writable.write (_stream_writable.js:316:11)
at Object.cursorTo (readline.js:1222:17)
at writeOnNthLine (/usr/share/yarn/lib/cli.js:49676:14)
at Spinner.render (/usr/share/yarn/lib/cli.js:97425:48)
at Spinner.start (/usr/share/yarn/lib/cli.js:97412:10)
at ConsoleReporter.activity (/usr/share/yarn/lib/cli.js:96958:13)
npm manifest:
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"@react-navigation/native": "^5.1.4",
"expo": "~37.0.3",
"react": "~16.9.0",
"react-dom": "~16.9.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-37.0.0.tar.gz",
"react-native-web": "~0.11.7"
},
"devDependencies": {
"@babel/core": "^7.8.6",
"babel-preset-expo": "~8.1.0"
},
"private": true
}
yarn manifest:
No manifest
Although the error says this is a permission issue, running the command with sudo
did not work.
What could be causing this error?
Upvotes: 0
Views: 639
Reputation: 11
I had this issue as well, and it seemed to be around having node.js installed via snap. Something around permissions of files from within the snap environment although I'm not entirely sure why npm and yarn work normally but just not when run via expo
Uninstalling the snap version of node and installing via apt resolved the issue for me, and if you would like a later version of node than is supported on the Ubuntu apt repository then there is a good tutorial here
Upvotes: 1