Facing issue with yo jhipster --force shell command - jhipster

When we are trying to execute yo jhipster --force --skip-git --skip-install from jenkins shell job,
we are receiving the below output:
Easy with the sudo. Yeoman is the master around here.
since yo is a user command, there is no need to execute it with root permissions. if you're having permission errors when using yo without sudo, please spend a few minutes learning more about how your system should work and make any necessary repairs.
Yo is being installed in the server using docker file with the command RUN sh -c 'yo#3.1.1 --unsafe-perm=true --allow-root'
previously we were not facing this issue with the use of yo.
the jenkins shell screenshot

Related

Running electron as root on Linux

I am making an application with electron which uses the wiring-pi library. This needs access to the GPIO on my Raspberry Pi, which requires root.
When I run electron . in the folder, the app opens fine but then says (in the terminal):
wiringPiSetup: Must be root. (Did you forget sudo?)
However when I try sudo electron ., I get an error:
sudo: electron: command not found
Does anyone know why this is happening?
Also, for the record, the same thing happens when I run npm as root:
pi#raspberrypi:~/rubiks-robot $ sudo npm
sudo: npm: command not found
Any ideas of how I can fix this issue and run Electron as root?
it looks like a problem of environment variables. The environmnet variables are set for your user but not for root.
Try to ship your variables with the "-E" switch of the sudo command:
sudo -E command
Please try to see here for other similar questions
How to keep Environment Variables when Using SUDO

Jenkins cannot run npm or pm2 by itself

So I have a Jenkins CI setup on an EC2 server. I have nodejs and npm installed. Weirdly, Jenkins can access them via the command line if I do something like:
sudo -u jenkins node -v
However, Jenkins cannot access them inside an actual build runtime, and I get the following errors:
npm: command not found
pm2: command not found
npm is definitely installed, and ec2-user/root users can access it. What PATH do I have to change so that Jenkins can access it too?
I think that if you use the nodejs plugin it will be easier to manage your node and npm in this box. Also, this plugin allows installing some global modules that possibly you will need to build your project:
https://wiki.jenkins-ci.org/display/JENKINS/NodeJS+Plugin

Running node apps with CodeDeploy

I am using Codeship as my CI tool, I integrate it with AWS CodeDeploy service. The procedure is perfect until my appspec.yml file calls my script to run the node app. Even though I have npm, node, bower and grunt installed I get command not found errors.
I would try editing your start_server.sh and adding npm and node to the $PATH environment variable or put that path directly in the command itself.
So instead of
npm install
Try
/usr/local/bin/npm install
That might not be where your npm lives but if you need to find out just do which npm
Perform the below steps:
which node
sudo ln -s /home/ubuntu/.nvm/versions/node/v12.13.1/bin/node (output of above step) /usr/bin/node
which npm
sudo ln -s /home/ubuntu/.nvm/versions/node/v12.13.1/bin/npm (output of above step) /usr/bin/npm
and try to use it via /usr/bin/npm install
I hope this will help you!!
For people who still might run into the same problem.
Check your appspec.yml file and look at the destination, it should contain something like /home/ec2-user....
in this case we need to make sure code deploy agent runs with that user profile (ec2-user). Check this link for steps to to make code deploy to run with your user profile

Hubot installation error where --create does not create a directory

I'm trying to heroku-deploy a hubot application (into Slack, if that matters). I'm developing locally on Ubuntu 14.04. I am closely following these instructions.
Here are my steps...
sudo apt-get install node npm
sudo npm install -g hubot coffee-script
hubot --create myrobot
However, nothing at all is created, there is no myrobot directory---and there is no statement of error. Honestly, I'm not even sure where to look for debugging information.
It doesn't make a difference, but is good practice to be doing all this within a cloned git:hubot-slack directory?
The issue was resolved by creating a symlink from nodejs to node.

setting up node-supervisor for nodeJS

Hi I'm a nodeJS and command line noob. I've managed to get a linux box up running and everything is fine. However restarting the node scripts every time I make changes is beginning to frustrate.
So I'm trying to set up node supervisor.
https://github.com/isaacs/node-supervisor
All installed fine but
when I try to set it up using the following from the command line (putty)
supervisor test.js
I get
supervisor: command not found
Does anyone have any idea why this would be?
many thanks
it means supervisor isn't in your path or wasn't set with execute permissions. Find supervisor then use the full path to it. it's possibly still in the build folder if you forgot to install it system-wide.
You should install supervisor globally with -g command option
> npm install -g supervisor

Resources