React Native Expo set up on macOS - react-native

After downloading watchman through brew and an expo blank template for my project I have attempted to run a yarn start within the terminal however, I get back the following error:
2022-06-21T09:09:00,229: [] while computing sockname: failed to create /opt/local/var/run/watchman/theflood-state: No such file or directory
Watchman: watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2022-06-21T09:09:00,229: [] while computing sockname: failed to create /opt/local/var/run/watchman/theflood-state: No such file or directory
/Applications/Telsa-project/TelsaClone/node_modules/metro-hermes-compiler/src/emhermesc.js:77
throw ex;
^
Error: watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2022-06-21T09:09:00,229: [] while computing sockname: failed to create /opt/local/var/run/watchman/theflood-state: No such file or directory
at ChildProcess.<anonymous> (/Applications/Telsa-project/TelsaClone/node_modules/fb-watchman/index.js:198:18)
at ChildProcess.emit (node:events:527:28)
at maybeClose (node:internal/child_process:1092:16)
at Socket.<anonymous> (node:internal/child_process:451:11)
at Socket.emit (node:events:527:28)
at Pipe.<anonymous> (node:net:709:12)
Emitted 'error' event on Client instance at:
at spawnError (/Applications/Telsa-project/TelsaClone/node_modules/fb-watchman/index.js:170:10)
at ChildProcess. (/Applications/Telsa-project/TelsaClone/node_modules/fb-watchman/index.js:198:7)
at ChildProcess.emit (node:events:527:28)
[... lines matching original stack trace ...]
at Pipe. (node:net:709:12)
error Command failed with exit code 7.
I've tried to reinstall watchman but that doesn't seem to make a difference.
Does anyone know how I might go about fixing this error?

Related

Error on any command npm. Error on any command npm

TypeError: invalid options argument at optsArg (/node_modules/mkdirp/lib/opts-arg.js:13:11) at mkdirp (/node_modules/mkdirp/index.js:11:10) at inferOwner.then.owner (/usr/share/npm/node_modules/gentle-fs/lib/mkdir.js:14:5) Error: npm.load() required at Object.get (/usr/share/npm/lib/npm.js:59:13) at process.errorHandler (/usr/share/npm/lib/utils/error-handler.js:205:32) at process.emit (events.js:198:13) at emitPromiseRejectionWarnings (internal/process/promises.js:140:18) at process._tickCallback (internal/process/next_tick.js:69:34) /usr/share/npm/lib/npm.js:59 throw new Error(npm.load() required) ^ Error: npm.load() required at Object.get (/usr/share/npm/lib/npm.js:59:13) at process.errorHandler (/usr/share/npm/lib/utils/error-handler.js:205:32) at process.emit (events.js:198:13) at process._fatalException (internal/bootstrap/node.js:497:27)
What's going on here? I do not understand anything
clean ubuntu focal.
Deleted /node_modules and installed npm via nvm. Now it works.

Running npx create-expo-module results in "Error: npm exited with non-zero code: 1"

I'm trying to create my own Expo module following the instructions in the Expo documentation.
When I run the command npx create-expo-module and I fill out the information that it asks me for (name of npm package, module name, GitHub profile, etc.), it manages to do the first two steps of the module creation:
✔ Downloaded module template from npm
✔ Created the module from template files
But then it gives me this error in the 3rd step:
✖ Installing module dependencies
Error: npm exited with non-zero code: 1
at ChildProcess.completionListener (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\#expo\spawn-async\build\spawnAsync.js:41:23)
at Object.onceWrapper (node:events:628:26)
at ChildProcess.emit (node:events:513:28)
at ChildProcess.cp.emit (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (node:internal/child_process:1100:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
...
at spawnAsync (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\#expo\spawn-async\build\spawnAsync.js:7:23)
at installDependencies (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\packageManager.js:9:37)
at C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\create-expo-module.js:49:56
at newStep (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\utils.js:21:22)
at Command.main (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\create-expo-module.js:48:31) {
pid: 23924,
output: [ '', '' ],
stdout: '',
stderr: '',
status: 1,
signal: null
}
I'm able to create new Expo projects with expo init without an issue and run them with expo start, so I don't know what the issue could be. My version of the Expo CLI is 6.0.6 and npm is 8.19.2.

turtle-cli: Error: 'expo-module-prepare' does not exist

Trying to build a dev version of an APK (Android) but I keep getting the following error.
14572 timing reify:rollback:createSparse Completed in 5948ms
14573 timing reify:rollback:retireShallow Completed in 14ms
14574 timing command:install Completed in 278406ms
14575 verbose stack Error: command failed
14575 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/#npmcli/promise-spawn/lib/index.js:63:27)
14575 verbose stack at ChildProcess.emit (node:events:527:28)
14575 verbose stack at maybeClose (node:internal/child_process:1092:16)
14575 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
14576 verbose pkgid #expo/html-elements#0.0.2
14577 verbose cwd /Users/faisaliqbal/.turtle/workingdir/android/sdk42
14578 verbose Darwin 21.3.0
14579 verbose node v16.15.1
14580 verbose npm v8.11.0
14581 error code 1
14582 error path /Users/faisaliqbal/.turtle/workingdir/android/sdk42/packages/html-elements
14583 error command failed
14584 error command sh -c expo-module prepare
14585 error /Users/faisaliqbal/.turtle/workingdir/android/sdk42/node_modules/commander/index.js:837
14585 error throw new Error(executableMissing);
14585 error ^
14585 error
14585 error Error: 'expo-module-prepare' does not exist
14585 error - if 'prepare' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
14585 error - if the default executable name is not suitable, use the executableFile option to supply a custom name
14585 error at ChildProcess.<anonymous> (/Users/faisaliqbal/.turtle/workingdir/android/sdk42/node_modules/commander/index.js:837:15)
14585 error at ChildProcess.emit (node:events:527:28)
14585 error at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
14585 error at onErrorNT (node:internal/child_process:478:16)
14585 error at processTicksAndRejections (node:internal/process/task_queues:83:21)
14586 verbose exit 1
14587 timing npm Completed in 278532ms
14588 verbose unfinished npm timer reify 1656882423113
Here are the versions of the app I am using.
Note: This project is working and compiling fine on another machine.
OS - darwin 12.2.1 (Monterey)
turtle - 0.27.4
Java (2) Versions:
java 18.0.1.1 2022-04-22
openjdk 11.0.15 2022-04-19
expo - 5.4.12
nodejs - v16.15.1
npm - 8.11.0
setup:android is all good
setup:ios is all good
IPA (IOS Binary) compiles without any issue.
Command to start the build:
turtle build:android \
--keystore-path ./keystore/keystore_android.jks \
--keystore-alias "store (redacted)" \
--allow-non-https-public-url \
--gradle-args "--warning-mode all" \
--public-url expo_url (redacted) \
-t apk
What might be the causing this?
Downgrading NodeJS version from 16 to 14 helped.
I originally installed NodeJS using official installer and after removing the installed version I reinstalled node using brew:
brew install node#14
(everything else I specified in my question was left untouched.

"Already up-to-date" and "Run 'yarn' to install missing dependencies"?

I've got a bit of a weird situation where "ember s" reports "Missing yarn packages" followed by a list of missing packages (two of them) and then "Run 'yarn' to install missing dependencies".
However when I run 'yarn' I get the message "success Already up-to-date" .
Any ideas how to get out of this circle ?
There's something I did immediately before this started which I guess is the source of my problem
Getting rid of an Add-on
I had installed an Ember Add-on which had generated problems so I decided to get rid of it . To do that I did the following :
git push -f origin 913c2dee12b0363df0664c9c63e0443abe0adb57:foo-bar
git reset --hard 913c2dee12b0363df0664c9c63e0443abe0adb57
yarn
yarn install
yarn clean
yarn install
yarn
Where 913c2dee12b0363df0664c9c63e0443abe0adb57 was the last commit before the unwanted add-on was installed. I don't think there was anything wrong in doing that but now I'm wondering.
Output of running Ember Server
When I run 'ember s' I get this output ...
DEPRECATION: ember-cli-babel 5.x has been deprecated. Please upgrade to at least ember-cli-babel 6.6. Version 5.2.8 located: foobar -> ember-cli-build-date -> ember-cli-babel
Missing yarn packages:
Package: #bower_components/jquery
* Specified: jquery/jquery-dist#
* Installed: (not installed)
Package: #bower_components/jstree
* Specified: vakata/jstree#^3.3.5
* Installed: (not installed)
Run `yarn` to install missing dependencies.
Stack Trace and Error Report: /tmp/error.dump.33c6e8c0abc9fc8abd355dc080268f9c.log
An error occurred in the constructor for ember-cli-dependency-checker at /media/mint/dev/foobar/node_modules/ember-cli-dependency-checker
Warning about ember-cli versions
I don't think this is relevant but just for completeness
Running the 'yarn' results in the following appearing in the output text ...
warning foobar#0.0.0: "dependencies" has dependency "ember-cli" with range "~3.8.1" that collides with a dependency in "devDependencies" of the same name with version "3.8"
EDIT: OK I was able to resolve this with the help of the comment by dwenzel ...
rm -rf node_modules && yarn
Although that actually led into a different issue which I'm almost certain was unrelated but I'll just mention it here in case it's useful to those who come after.
The execution of yarn initially failed with the following error ...
35238 verbose stack Error: node-sass#4.5.3 postinstall: `node scripts/build.js`
35238 verbose stack Exit status 1
35238 verbose stack at EventEmitter.<anonymous> (/home/rshea/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
35238 verbose stack at EventEmitter.emit (events.js:189:13)
35238 verbose stack at ChildProcess.<anonymous> (/home/rshea/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
35238 verbose stack at ChildProcess.emit (events.js:189:13)
35238 verbose stack at maybeClose (internal/child_process.js:970:16)
35238 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
35239 verbose pkgid node-sass#4.5.3
35240 verbose cwd /media/mintextra/dev/ddn-build-test-temp/foobar
35241 verbose Linux 3.13.0-169-generic
35242 verbose argv "/home/rshea/.nvm/versions/node/v10.15.3/bin/node" "/home/rshea/.nvm/versions/node/v10.15.3/bin/npm" "install"
35243 verbose node v10.15.3
35244 verbose npm v6.4.1
35245 error code ELIFECYCLE
35246 error errno 1
35247 error node-sass#4.5.3 postinstall: `node scripts/build.js`
35247 error Exit status 1
35248 error Failed at the node-sass#4.5.3 postinstall script.
35248 error This is probably not a problem with npm. There is likely additional logging output above.
35249 verbose exit [ 1, true ]
I was able to resolve that with ...
npm install node-sass#latest
npm install
... at which point ember s was able to run without errors.
It looks like you want to do yarn install --check-files to verify that the files have not been removed from node_modules. This avoids having to wipe out your node_modules file which can be time consuming.
https://classic.yarnpkg.com/en/docs/cli/install/#toc-yarn-install-check-files
https://github.com/yarnpkg/yarn/issues/2240
When yarn gets confused like this, you can usually fix things up by clearing out your node modules before installing:
rm -rf node_modules && yarn
The way I managed to get around this without deleting the entire node_modules directory was just to remove the module from topLevelPatterns within node_modules/.yarn-integrity.
Disclaimer: I don't know what the implications of this are but yarn's integrity was already questionable and it works so meh!?
You may also try to reinstall/download all packages with:
yarn install --force

npm install error Invalid Package: expected taffydb but found taffydb-jsdoc

Running npm install and failed with error the following is from npm-debug.log file The same commands works yesterday. There's no change in package.json file.
15065 info install gulp-jsdoc#0.1.5
15066 info postinstall gulp-jsdoc#0.1.5
15067 verbose unlock done using /home/centos/.npm/_locks/gulp-jsdoc-a48e57f10f1c6755.lock for /data/jenkins/workspace/node_modules/gulp-jsdoc
15068 verbose stack Error: Invalid Package: expected taffydb but found taffydb-jsdoc
15068 verbose stack at /usr/lib/node_modules/npm/lib/cache/add-local-tarball.js:127:21
15068 verbose stack at /usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:356:5
15068 verbose stack at checkBinReferences_ (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:320:45)
15068 verbose stack at final (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:354:3)
15068 verbose stack at then (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:124:5)
15068 verbose stack at /usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:243:12
15068 verbose stack at /usr/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16
15068 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)
15069 verbose cwd /data/jenkins/workspace/
15070 error Linux 3.10.0-327.18.2.el7.x86_64
15071 error argv "/usr/bin/node" "/usr/bin/npm" "install"
15072 error node v4.4.5
15073 error npm v2.15.5
15074 error Invalid Package: expected taffydb but found taffydb-jsdoc
15075 error If you need help, you may report this error at:
15075 error <https://github.com/npm/npm/issues>
15076 verbose exit [ 1, true ]
15077 verbose unbuild node_modules/jsdoc
15078 info preuninstall jsdoc#3.3.0-alpha5
15079 info uninstall jsdoc#3.3.0-alpha5
Thanks
G.S.
It would appear that this latest commit in the taffydb-jsdoc fork has broken it:
https://github.com/hegemonic/taffydb/commit/507d2d75fa16e1386f6d50abee1894b264d4458b
(https://www.npmjs.com/package/taffydb-jsdoc)
(Description updated)
The package has been renamed from taffydb to taffydb-jsdoc, so npm is finding a conflict between the expected and the declared package names. In our case and the OP's, hegemonic's fork of taffydb is being referenced by jsdoc, which is a node module required by gulp-jsdoc:
https://github.com/jsBoot/gulp-jsdoc/blob/v0.1.4/package.json#L39
https://github.com/jsdoc3/jsdoc/blob/v3.3.0-alpha5/package.json#L26
EDIT: The author of this fork has contacted me to say the issue has been resolved, as shown in this new commit (package name reverted):
https://github.com/hegemonic/taffydb/commit/e41b5e179e197bb85c5fb887b707672b1e5ca079
I can confirm that our npm install(s) are now working again.