Oh, on npm it is npm run test
that gives the following error:
> Humboi@0.0.1 test /Users/prikshetsharma/Desktop/Humboi
> jest
sh: jest: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! Humboi@0.0.1 test: jest
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the Humboi@0.0.1 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/prikshetsharma/.npm/logs/2021-01-18T1422_50_869Z-debug.log
and the log file has the following content:
0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/local/bin/node’, ‘/usr/local/bin/npm’, ‘run’, ‘test’ ]
2 info using npm@6.14.8
3 info using node@v14.15.1
4 verbose run-script [ ‘pretest’, ‘test’, ‘posttest’ ]
5 info lifecycle Humboi@0.0.1~pretest: Humboi@0.0.1
6 info lifecycle Humboi@0.0.1~test: Humboi@0.0.1
7 verbose lifecycle Humboi@0.0.1~test: unsafe-perm in lifecycle true
8 verbose lifecycle Humboi@0.0.1test: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/prikshetsharma/Desktop/Humboi/node_modules/.bin:/opt/X11/bin:/Users/prikshetsharma/.rbenv/shims:/usr/local/opt/ruby/bin:/usr/local/opt/ruby/lib/ruby/gems/2.7.0/bin:/usr/local/opt/ruby/bin:/usr/local/bin:/Users/prikshetsharma/Library/Android/sdk/platform-tools:/Users/prikshetsharma/Library/Android/sdk/emulator:/usr/local/opt/ruby/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/share/dotnet:/opt/X11/bin:/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/prikshetsharma/.rvm/bin:/usr/local/bin:/Users/prikshetsharma/Library/Android/sdk/emulator:/Users/prikshetsharma/Library/Android/sdk/tools:/Users/prikshetsharma/Library/Android/sdk/tools/bin:/Users/prikshetsharma/Library/Android/sdk/platform-tools
9 verbose lifecycle Humboi@0.0.1~test: CWD: /Users/prikshetsharma/Desktop/Humboi
10 silly lifecycle Humboi@0.0.1~test: Args: [ ‘-c’, ‘jest’ ]
11 info lifecycle Humboi@0.0.1~test: Failed to exec test script
12 verbose stack Error: Humboi@0.0.1 test: jest
12 verbose stack spawn ENOENT
12 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack at ChildProcess.emit (events.js:315:20)
12 verbose stack at maybeClose (internal/child_process.js:1048:16)
12 verbose stack at Process.ChildProcess.handle.onexit (internal/childprocess.js:288:5)
13 verbose pkgid Humboi@0.0.1
14 verbose cwd /Users/prikshetsharma/Desktop/Humboi
15 verbose Darwin 20.2.0
16 verbose argv “/usr/local/bin/node” “/usr/local/bin/npm” “run” “test”
17 verbose node v14.15.1
18 verbose npm v6.14.8
19 error code ELIFECYCLE
20 error syscall spawn
21 error file sh
22 error errno ENOENT
23 error Humboi@0.0.1 test: jest
23 error spawn ENOENT
24 error Failed at the Humboi@0.0.1 test script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]
Did you add the dependencies on package.json
? And run npm install
after adding the dependencies?
yes I have already run npm install
but am still getting the error
how to fix it?
Is the project on github? Or can you paste your package.json?
I think this is the lock one. I want the one used for configuration.
{ "name": "Humboi", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "@react-native-async-storage/async-storage": "^1.13.2", "@react-native-community/cameraroll": "^4.0.1", "@react-native-community/masked-view": "^0.1.10", "@react-navigation/bottom-tabs": "^5.11.3", "@react-navigation/native": "^5.9.0", "@unimodules/core": "^7.0.0", "create-react-class": "^15.7.0", "expo-camera": "^9.1.1", "react": "16.13.1", "react-dom": "^16.13.0", "react-native": "0.63.4", "react-native-camera": "^3.42.0", "react-native-camera-roll-picker": "^2.0.0", "react-native-elements": "^3.1.0", "react-native-gesture-handler": "^1.9.0", "react-native-google-signin": "^2.1.1", "react-native-reanimated": "^1.13.2", "react-native-safe-area-context": "^3.1.9", "react-native-screens": "^2.16.1", "react-native-vector-icons": "^7.1.0", "react-native-video": "^4.3.0" }, "devDependencies": { "@babel/core": "^7.8.4", "@babel/runtime": "^7.8.4", "@react-native-community/eslint-config": "^1.1.0", "@testing-library/react-native": "^7.1.0", "babel-jest": "^25.1.0", "eslint": "^6.5.1", "jest": "^25.1.0", "metro-react-native-babel-preset": "^0.59.0", "react-test-renderer": "16.13.1" }, "jest": { "preset": "react-native", "testPathIgnorePatterns": [ "/node_modules/", "/.shadow-cljs/" ], "testMatch": [ "/test-out//*_test.js" ], "snapshotResolver": "<rootDir>/customSnapshotResolver.js" } }
What is the output of running npm install
?
npm WARN @react-native-community/cameraroll@4.0.1 requires a peer of react-native@>=0.57 <=0.62 but none is installed. You must install peer dependencies yourself.
npm WARN expo-camera@9.1.1 requires a peer of unimodules-barcode-scanner-interface@* but none is installed. You must install peer dependencies yourself.
npm WARN expo-camera@9.1.1 requires a peer of unimodules-camera-interface@* but none is installed. You must install peer dependencies yourself.
npm WARN expo-camera@9.1.1 requires a peer of unimodules-face-detector-interface@* but none is installed. You must install peer dependencies yourself.
npm WARN expo-camera@9.1.1 requires a peer of unimodules-file-system-interface@* but none is installed. You must install peer dependencies yourself.
npm WARN expo-camera@9.1.1 requires a peer of unimodules-permissions-interface@* but none is installed. You must install peer dependencies yourself.
removed 9 packages and audited 1380 packages in 4.168s
14 packages are looking for funding
run npm fund
for details
found 4 low severity vulnerabilities
run npm audit fix
to fix them, or npm audit
for details
prikshetsharma@vpn13-222 Humboi % npm run test
> Humboi@0.0.1 test /Users/prikshetsharma/Desktop/Humboi
> jest
sh: jest: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! Humboi@0.0.1 test: jest
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the Humboi@0.0.1 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/prikshetsharma/.npm/logs/2021-01-18T1442_54_628Z-debug.log
prikshetsharma@vpn13-222 Humboi % npm install
npm WARN @react-native-community/cameraroll@4.0.1 requires a peer of react-native@>=0.57 <=0.62 but none is installed. You must install peer dependencies yourself.
npm WARN expo-camera@9.1.1 requires a peer of unimodules-barcode-scanner-interface@* but none is installed. You must install peer dependencies yourself.
npm WARN expo-camera@9.1.1 requires a peer of unimodules-camera-interface@* but none is installed. You must install peer dependencies yourself.
npm WARN expo-camera@9.1.1 requires a peer of unimodules-face-detector-interface@* but none is installed. You must install peer dependencies yourself.
npm WARN expo-camera@9.1.1 requires a peer of unimodules-file-system-interface@* but none is installed. You must install peer dependencies yourself.
npm WARN expo-camera@9.1.1 requires a peer of unimodules-permissions-interface@* but none is installed. You must install peer dependencies yourself.
removed 9 packages and audited 1380 packages in 5.365s
14 packages are looking for funding
run npm fund
for details
found 4 low severity vulnerabilities
run npm audit fix
to fix them, or npm audit
for details
Try to run npm run test
. You did not installed jest globally so running jest
is not expected to work.
So @ps, I think you have what you need for the solution.
As you can see in my response here https://clojurians.slack.com/archives/C0E1SN0NM/p1610920769030000?thread_ts=1610907711.025500&cid=C0E1SN0NM and @olivergeorge’s example above, the renderItem
argument is a JS Object.
So you can't use (:name video)
or (:url video)
lookup like with a CLJ map.
You can use goog.object
like in theses examples or libraries like:
• cljs-oops https://github.com/binaryage/cljs-oops
• js-interop https://github.com/applied-science/js-interop
So in you case, you end up with a video-comp like that:
(ns your.ns
(:require [goog.object :as gobj])
(defn video-comp [video]
[:> View
[:> Video
{:style {:height 400
:width "100%"}
:controls true
:paused true
:source {:uri (gobj/get video "uri")}}]
[:> Text (gobj/get video "name")]])
1🙏1🙌1✅