manual set-up error: Command failed: /tmp/rncli-init-template-lRLLcg/node_modules/react-native-template-pytorch-live/script.js
See original GitHub issueVersion
No response
Problem Area
react-native-pytorch-core (core package)
Steps to Reproduce
OS: Ubuntu 20.04.3 LTS
python3 -V
: Python 3.8.5
List of all installed node.js modules with npm -g ls --depth=0
:
/usr/local/lib
├── corepack@0.10.0
├── expo-cli@4.13.0
├── n@8.0.1
├── npm@8.1.2
└── yarn@1.22.17
command: npx react-native init MyFirstProject --template react-native-template-pytorch-live
Expected Results
###### ######
### #### #### ###
## ### ### ##
## #### ##
## #### ##
## ## ## ##
## ### ### ##
## ######################## ##
###### ### ### ######
### ## ## ## ## ###
### ## ### #### ### ## ###
## #### ######## #### ##
## ### ########## ### ##
## #### ######## #### ##
### ## ### #### ### ## ###
### ## ## ## ## ###
###### ### ### ######
## ######################## ##
## ### ### ##
## ## ## ##
## #### ##
## #### ##
## ### ### ##
### #### #### ###
###### ######
Welcome to React Native!
Learn once, write anywhere
✔ Downloading template
✔ Copying template
✔ Processing template
⠙ Executing post init script node:child_process:903
throw err;
^
Error: Command failed: cd ./models && python3 -m venv ./venv 2> ./error.log && source ./venv/bin/activate 2> ./error.log && pip install --upgrade pip 2> ./error.log && pip install -r requirements.txt 2> ./error.log && python -W ignore make_models.py 2> ./error.log
at checkExecSyncError (node:child_process:826:11)
at execSync (node:child_process:900:15)
at Object.<anonymous> (/tmp/rncli-init-template-lRLLcg/node_modules/react-native-template-pytorch-live/script.js:16:5)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
status: 127,
signal: null,
output: [ null, Buffer(0) [Uint8Array] [], Buffer(0) [Uint8Array] [] ],
pid: 12763,
stdout: Buffer(0) [Uint8Array] [],
stderr: Buffer(0) [Uint8Array] []
}
✖ Executing post init script
error Error: Command failed: /tmp/rncli-init-template-lRLLcg/node_modules/react-native-template-pytorch-live/script.js
if needed, I can supply the outcome when run with --verbose
Code example, screenshot, or link to repository
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Installing playwright using npm gives error `command failed`
I tried to install playwright using the command npm i playwright. But got an error npm ERR! code 1 npm ERR! path ...
Read more >Npm install command failing with message "could not find ...
When I run the npm install command, npm starts downloading the dependencies. But then, suddenly, it stops with the error:
Read more >Error - JavaScript - MDN Web Docs - Mozilla
Error objects are thrown when runtime errors occur. The Error object can also be used as a base object for user-defined exceptions.
Read more >Addressing common errors in React Native - LogRocket Blog
Explore common React Native errors such as "command not found" and learn about ... BUILD FAILED in 13s error Failed to install the...
Read more >Troubleshooting Common Errors - Gatsby
If you encounter a webpack error that says Generating SSR bundle failed after installing a plugin and trying to run gatsby develop or...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
To answer your question:
I think I could not even install the models properly. And was not able to run it on any device.
I was not sure if I should use
npx react-native init
ornpx torchlive-cli init
to initialize a project based onreact-native-template-pytorch-live
.Both commands seems successful.
I make sure my emulator is running.
Below are reporting the results of the two methods (both fail).
first version - with
npx react-native run-android
second version - with
npx torchlive-cli run-android
cd MyFirstProjectCLI && npx torchlive-cli run-android
but the emulator shows a message in red:
I start metro:
then again
npx torchlive-cli run-android
. It ends withBUILD SUCCESSFUL in 22s
.then in the
metro
terminal, it start bundling ./index.js` but fails with:in
MyFirstProjectCLI/models
there are,if I
touch detr_resnet50.ptl
, then comes the next errorUnable to resolve module ../../models/mnist.ptl
.By the way,
npx torchlive-cli doctor
gives:There is definitely something wrong with my installation.
I will stop my experiments here and wait for the linux support.
Thank you @aaronespasa for your help!
Thank you @liuyinglao Indeed,
python3 -W ignore make_models.py
could create the missing models.One issue I had was with which
env
to activate. At the end, what worked for me was to use thevenv
of my first version (manual set up) which was correct, and runpython3 -W ignore make_models.py
in the second project (with CLI).A bit complicated. But eventually, I could start the app, both on the device and in the emulator.
Again, thank you both for your help. The issue can be closed