DroidEdit Termux integration - javascript

DroidEdit allows you to run commands if you have sl4a installed and the am command works wonderfully... I was wondering if there is a way to use am to launch an app with params .. specifically I want a command that will tell termux to run a command on a file that I specificy ... so far I found this snippet that launches the termux app .. now how do I get it to run node or webpack from npm as well?
am start --user 0 -n com.termux/com.termux.app.TermuxActivity

Related

build failed react-native 0.6.5 We ran "xcodebuild" command but it exited with error code 65

I'm having this problem "error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening starter.xcodeproj. Run CLI with --verbose flag for more details." since I pulled the latest update from the other colleague, I can't run the project in my simulator, but my colleagues side works fine.
I've tried to change the build system to legacy build system.
Clone the project again.
remove the build folder under iOS folder, and run again.
remove the node module folder and run again.
I have tested in different device is not working too.
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening starter.xcodeproj. Run CLI with --verbose flag for more details.
User defaults from command line:
IDEDerivedDataPathOverride = /Users/nexplatform/Desktop/padini scm mobile/SCM/ios/build/starter
brew install cocoapods
cd projectfolder/ios
pod install
and
cd..
react-native run-ios

How to run node.js application from script?

I am trying to run my node.js application from a script I have written:
echo "Starting node application"
sudo node /home/pi/PPBot/bot.js
exit 0
I run the script like this: sudo /etc/init.d/botscript
The output when running the script is:
Start node application
sudo: node: command not found
I have also tried replacing node by /home/pi/.nvm/versions/node/v.8.11.3/bin/node but this resulted in the same output.
I have already installed NodeJS through NVM. Simply using the command node bot.js works from the command line. However as can be seen above it does not work through the script.
if you want to run a simple node js file then use the command
-> node filename
ex.: node server.js
if you want to run a node js file with nodemon then use the command
-> nodemon filename
ex.: nodemon server.js

Http-server running in background with nohup doesn't remain live

I have an ubuntu server. On which I have transferred some files which have some js and html code.
I used http-server from node.js to start a web server so that I can display the html page on the server.
I used nohup so that it can remain running even if I disconnect or close my system.
Here is the command I used:
nohup http-server -p 8000 -a 10.4.145.182 &
Now this helps me visualize the files on 10.4.145.182:8000 but I am noticing after sometime the server goes down and one can't access the html page on that ip in their browser.
I thought nohup helps run things in background even if one closes their system or logs out of server.
How do I make this web server running always then and accessible to url to everyone
Thanks
EDIT:
As per the suggestion below of using pm2, I installed latest version of node and then started service with pm2.
It says service started for http-server but when I go the to ip with port 8000 on browser it doesn't open up.
Here is the command I ran in my directory which has the html and d3 files.
$ pm2 start $(which http-server) -p 8000
And here is the output in shell of the pm2
Try this:
http-server & exit
You can also specify a port number:
http-server -p 8082 & exit
Reference here
I suggest you use pm2 . Long story short , check the official link https://www.npmjs.com/package/pm2
Steps :
Install :
npm install pm2 -g
Run your app :
pm2 start app.js
In your case use :
pm2 start /usr/local/bin/http-server -- -p 8080
for reboot to work run :
pm2 startup systemd
take the last line , change the user and home path and run the modified line as SUDO !!! you need sudo access for this !!!

Error in protobuf | npm ERR! code ELIFECYCLE :: while setting Sawtooth JavaScript Transaction Processor in Ubuntu 16.04

Currently working on sawtooth example
Things I have done :
Installed latest Node(8.11.3)& npm version.
Started javascript
essential thing using docker-compose up.
Things giving error:
Want to setup Javascript transaction processor so moved to dir jsprocessor.
Trying to install all node modules using $ npm i, but giving error shown in image. I think it is relate to node js.
Reinstalled Node & NPM, Externally installed npm module that producing error but no effect.
What am I doing wrong?
I would follow the directions at
https://github.com/askmish/sawtooth-simplewallet
Which seems different from what you ran.
Build and start the Docker containers:
docker-compose -f simplewallet-build-client-js.yaml up
Open bash shell in simplewallet-client-js container:
docker exec -it simplewallet-client-js bash
Create user accounts for jack and jill:
sawtooth keygen jack && sawtooth keygen jill
Open two new browser tabs and go to http://localhost:3000 on each tab.
Login in one tab as jack and in other as jill Start with an initial deposit for each user - jack and jill via the Deposit tab in the UI homepage

Error installing node.js on google compute engine docker image

I am trying to setup a node.js app inside docker, using as host the google compute engine VM gci-stable-55-8872-71-0 (debian), from image project google-containers:
$ gcloud compute instances create myvm --image-project google-containers --image gci-stable-55-8872-71-0 --zone europe-west1-b --machine-type f1-micro --scopes compute-rw
then I try to get a docker container running:
$ sudo docker build -t forperfuse/test .
but I keep getting errors when installing node:
The command '/bin/sh -c npm install' returned a non-zero code: 1
all other dependencies install well but node and npm are not installing- I have tried several options but still cannot get it to work, can you please help? many thanks in advance...
I'm not sure about what is going on, looks like the run command in the dockerfile is aiming to a bash that has a weird header. If you can publish them we can try or...
You can use the bitnami docker image available in launcher for free and works like a charm.
https://console.cloud.google.com/launcher
And there search for the node.js image.

Categories