The bounty expires in 2 days. Answers to this question are eligible for a +50 reputation bounty.
Matt wants to draw more attention to this question.
I am using yarn v1 and need to debug yarn install in Heroku. I found it's possible by adding .yarnrc file with content:
--install.verbose true
How can I enable verbose mode only for production? If I try this, it doesn't work:
--install.verbose ${NODE_ENV === 'production'}
Since yarn allows NPM config with env variables.
You can setup NPM_CONFIG_LOGLEVEL=verbose inside your Heroku app.
For testing in your local machine:
Windows: set NPM_CONFIG_LOGLEVEL=verbose
MacOS/Linux: export NPM_CONFIG_LOGLEVEL=verbose
I have a webapp which is running in Node 16, I am updating to node 18. I have used below command to update.
az webapp config set -g RG_NAME -n APP_NAME --linux-fx-version "NODE|18LTS
once done, when I run az webapp config show, I can see its in Node 18, but the UI (Azure portal) doesnt show the latest changes, because the stack is choosen Empty. when I manually set the stack to Node, its showing properly. Is it just UI issue or I have to set any parameters to actually update the stack ?
I have created NodeJS App and deployed to Azure Linux App Service with NODE 16LTS.
Immediately after deploying the app, in Azure Portal I can see the stack as NODE 16.
As you have mentioned, updated the runtime stack with NODE 18 LTS with the given command.
az webapp config set -g YourRGName -n YourAppName --linux-fx-version "NODE|18LTS"
Even I can see the runtime stack setting becoming empty.
Is it just UI issue or I have to set any parameters to actually update the stack ?
AFAIK, we don't have any option to set the parameters while updating the stack.
Manually I have updated the runtime stack and again tried to update the version for the second time with CLI Command.
Again, I see the runtime stack option Empty. This is the default behavior of Azure App Service UI in Portal.
This question already has answers here:
How do I pass environment variables to Docker containers?
(20 answers)
Closed 5 years ago.
I'm trying to Dockerize a Node.js app and, while creating the Dockerfile, i came across the problem that the credetials for connecting to the database are stored in a .txt file. How can i set the content from that .txt file as an ENV variable in my Dockerfile?
You can use the --env-file command line option:
docker run --env-file ./env.list ubuntu bash
This file should use the syntax <variable>=value (which sets the
variable to the given value) or <variable> (which takes the value from
the local environment), and # for comments.
For more details, see the documentation here.
I have multiple entries of a process "solr" on linux. It is installed as service on system and I can see following entries:
Inside file rc.local
Start solr on VM start-up
/sbin/service solr start
Also under following files:
file: rc1.d
entry: K29solr -> ../init.d/solr
file: rc2.d
entry: K29solr -> ../init.d/solr
file: rc3.d
entry: S79solr -> ../init.d/solr
file: rc4.d
entry: S79solr -> ../init.d/solr
file: rc5.d
entry: S79solr -> ../init.d/solr
My question is will these multiple entries lead to triggering of multiple starting of this process solr? Currently only one process is running but logs depict another process might have got triggered but just want to be sure is these entries could be reason. I am linux expert so please bear with me.
It seems like you want this process to run regardless of the runlevel (rc.#). You should only need the one entry in rc.local.
Here is more information on runlevels and startup scripts:
https://www.linux.com/news/enterprise/systems-management/8116-an-introduction-to-services-runlevels-and-rcd-scripts
When the system starts, it finds the default run level from the /etc/inittab file.
It will then run any scripts that have symbolic-links in the relevant rcn.d directory.
If the symbolic-link starts with S it will pass "start" to the linked script, if it starts with K it will pass "stop" to the linked script.
That is why you will find mostly K-prefixed symbolic-links in the rc0.d and rc6.d directories, because runlevel 0 is shutdown and 6 is reboot.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
How to host a Node.Js application in a shared hosting
I want to host a node.js application in shared hosting. Does anyone have any reference or documentation to refer to?
You can run node.js server on a typical shared hosting with Linux, Apache and PHP (LAMP). I have successfully installed it, even with NPM, Express and Grunt working fine. Follow the steps:
1) Create a new PHP file on the server with the following code and run it:
<?php
//Download and extract the latest node
exec('curl http://nodejs.org/dist/latest/node-v0.10.33-linux-x86.tar.gz | tar xz');
//Rename the folder for simplicity
exec('mv node-v0.10.33-linux-x86 node');
2) The same way install your node app, e.g. jt-js-sample, using npm:
<?php
exec('node/bin/npm install jt-js-sample');
3) Run the node app from PHP:
<?php
//Choose JS file to run
$file = 'node_modules/jt-js-sample/index.js';
//Spawn node server in the background and return its pid
$pid = exec('PORT=49999 node/bin/node ' . $file . ' >/dev/null 2>&1 & echo $!');
//Wait for node to start up
usleep(500000);
//Connect to node server using cURL
$curl = curl_init('http://127.0.0.1:49999/');
curl_setopt($curl, CURLOPT_HEADER, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
//Get the full response
$resp = curl_exec($curl);
if($resp === false) {
//If couldn't connect, try increasing usleep
echo 'Error: ' . curl_error($curl);
} else {
//Split response headers and body
list($head, $body) = explode("\r\n\r\n", $resp, 2);
$headarr = explode("\n", $head);
//Print headers
foreach($headarr as $headval) {
header($headval);
}
//Print body
echo $body;
}
//Close connection
curl_close($curl);
//Close node server
exec('kill ' . $pid);
Voila! Have a look at the demo of a node app on PHP shared hosting.
EDIT: I started a Node.php project on GitHub.
Connect with SSH and follow these instructions to install Node on a shared hosting
In short you first install NVM, then you install the Node version of your choice with NVM.
wget -qO- https://cdn.rawgit.com/creationix/nvm/master/install.sh | bash
Your restart your shell (close and reopen your sessions). Then you
nvm install stable
to install the latest stable version for example. You can install any version of your choice. Check node --version for the node version you are currently using and nvm list to see what you've installed.
In bonus you can switch version very easily (nvm use <version>)
There's no need of PHP or whichever tricky workaround if you have SSH.
I installed Node.js on bluehost.com (a shared server) using:
wget <path to download file>
tar -xf <gzip file>
mv <gzip_file_dir> node
This will download the tar file, extract to a directory and then rename that directory to the name 'node' to make it easier to use.
then
./node/bin/npm install jt-js-sample
Returns:
npm WARN engine jt-js-sample#0.2.4: wanted: {"node":"0.10.x"} (current: {"node":"0.12.4","npm":"2.10.1"})
jt-js-sample#0.2.4 node_modules/jt-js-sample
└── express#4.12.4 (merge-descriptors#1.0.0, utils-merge#1.0.0, cookie-signature#1.0.6, methods#1.1.1, cookie#0.1.2, fresh#0.2.4, escape-html#1.0.1, range-parser#1.0.2, finalhandler#0.3.6, content-type#1.0.1, vary#1.0.0, parseurl#1.3.0, serve-static#1.9.3, content-disposition#0.5.0, path-to-regexp#0.1.3, depd#1.0.1, qs#2.4.2, on-finished#2.2.1, debug#2.2.0, etag#1.6.0, proxy-addr#1.0.8, send#0.12.3, type-is#1.6.2, accepts#1.2.7)
I can now use the commands:
# ~/node/bin/node -v
v0.12.4
# ~/node/bin/npm -v
2.10.1
For security reasons, I have renamed my node directory to something else.
A2 Hosting permits node.js on their shared hosting accounts. I can vouch that I've had a positive experience with them.
Here are instructions in their KnowledgeBase for installing node.js using Apache/LiteSpeed as a reverse proxy: https://www.a2hosting.com/kb/installable-applications/manual-installations/installing-node-js-on-managed-hosting-accounts . It takes about 30 minutes to set up the configuration, and it'll work with npm, Express, MySQL, etc.
See a2hosting.com.
You should look for a hosting company that provides such feature, but standard simple static+PHP+MySQL hosting won't let you use node.js.
You need either find a hosting designed for node.js or buy a Virtual Private Server and install it yourself.