Installing KeystoneJS Error - javascript

Getting this error when trying to install KeystoneJS on DigitalOcean MEAN stack.
Getting this error: http://paste.ee/p/q1RmU
Using this command: sudo yo keystone (installed Yeoman)
Following this guide: http://keystonejs.com/getting-started/

I think that your running into a permissions issue with Yeoman. It is best practice to not use sudo for things like this.
I would suggest creating a user for keystone, logging in as that user, and following these instructions for 'globally' installing a npm module for a user. Essentially, you will setup a npm_packages directory for the user and add it to your path.
Once you've done that you can install yeoman as this user, and without sudo. This should allow you to install keystone okay. I know it seems like a lot of work, but this is the best way to securely set up a node app on a linux box.

I agree to KraigH. But An alternet way to get rid of this issue is changemod for whatever it complains.
I listed all possible dirs here.
chmod -R g+rwx /root /root/.config /root/.config/configstore /root/.npm
I tried to do what other says. that is to not use sudo. but it don't help.

I normally build a Docker image and deploy it behind a nginx reverse proxy

Related

How to deploy angular 7 project directly to my webserver, so that i shouldn't migrate my dist folder always after deployment?

Currently, I am deploying my Angular 7 Project by using FileZilla to migrate my local files from ./dist folder to server public_HTMl. This is a quite tides job to carry in a daily basis, so I want to deploy my code directly to the server, when I hit ng build --prod then those compiled files have to be migrated directly to the server. Do anybody here who can help me to solve this problem?
To get rid of this problem I have tried lots of steps:
I was using bitbucket pipelines to execute my code, it came to be costly and I cannot run it as well, It took several hours but cannot give output for me.
I also tried by using new Git Repository even it's a good way but cannot give me the solution because when I deploy my code locally it creates a new folder every time while I execute a command.
So, I want to get help and deploy this code directly to the server that is going to host my application. Thank you all and hope all of you provide me good tips regarding this problem.
You can do it in the simple way. Create basic bash/sh script or windows executable and use rsync to do this automatically:
deploy.sh:
#!/bin/bash
ng build --prod
rsync -arvt ./dist remoteuser#remotehost:/var/www/remotedirectory
To avoid entering login and password every time add RSA public key to your remote machine(trusted host). You can combine this solution with Bitbucket pipelines, when the free plan ends I run this script manually from my developer machine.
bitbucket-pipelines.yml:
image: mycustomimage:latest
pipelines:
default:
- step:
name: Build and deploy to production
caches:
- node
deployment: production
script:
- npm install
- npm install -g #angular/cli
- ng config -g cli.warnings.versionMismatch false
- ./deploy.sh
Instead of a simple script you can use some more complex solution like Capistrano, Shipit or some other more advanced tool. All depends on your needs...
The simplest solution is always the best :)

NPM Install giving rollbackFailedOptional

After trying to use the Windows Powershell (as an admin), the command prompt (as an admin) and the bash CMD; I repeatedly get the following error after trying an npm install command:
npm install npm#latest -g
is the attempted command and...
[...] / rollbackFailedOptional: verb npm-session xxxxxxxxxxx
where the 'x's represent different letter and number combinations at each attempt, is the message. I am aware that this should be the first step in the installation of a package but it remains on this message for a long time and will not change.
I am trying to use the JavaScript React library, more specifically the 'create-react-app'. The npm install -g create-react-app command is also causing the error.
npm version: 6.5.0
npx version: 10.2.0
node version: 10.15.0
A solution would be greatly appreciated.
https://docs.npmjs.com/try-the-latest-stable-version-of-npm In this link there is the documentation for updating npm version for windows with a link to a tool developed by Microsoft to update npm (https://github.com/felixrieseberg/npm-windows-upgrade)
I found the solution:
As my device username has both my first and last names, with a space in between, npm was reaching errors because of this. So the solution was to uninstall node from the default location and reinstall it in a folder on my C:\ drive, where there were no files in the directory that have spaces in the names. I then changed the cache location into this same C:\ drive folder, and the problem was solved.
npm config set cache C:\NODEJS\npm-cache
(these folders must be created before you can set the config directory to these.)
For me, I ended up having to:
Uninstall Node.js
Remove the folder "nodejs" completely from C:\Program Files (or
wherever you decided to install node)
Reinstall Node.js
After that, I did not encounter [...] / rollbackFailedOptional: verb npm-session xxxxxxxxxxx anymore.
I'm not quite sure what the issue was but all suggestions I found on stack did not solve this problem for me. I hope this helps someone.
Check if you are connected to any other VPN or proxy setting. If so try to disable it or disconnect from it and then execute the npm command. It worked for me. In my case, I was using the organization laptop and was connected to external vpn network, so i disabled the vpn and tried the command and it worked.
In our case the hard disc of the nexus server (repository server) was just full. Maybe someone helps this. Before looking into other more complicated options.
for my case i uninstalled the reinstelled it and used powershell insted of cmd and it worked like a charm
First run these commands.
npm config rm proxy
npm config rm https-proxy
then run this.
npm config set registry https://registry.npmjs.org/
check if the internet is connected
and try to run the npm command which was giving the error.

How do I run a copied project in Node.js

https://github.com/gleitz/mahjong
I want to run this app on my windows,
the directions say:
-Install dependencies with npm update
-Start the application with node app.js
it's sound easy so I try myself.
1.Fist of all , I install node.js on it's official website (https://nodejs.org/en/)
I download the 8.9.3 version.
after installing node.js
2.open the command line and go to the project path.
3.then I input the command npm update.
it works,and the node_modules folder is created.But there are some warn message
4.finally input the command node app.js... it's not work with many error message
following is wrong message
I wonder know how should I do.Is any thing I didn't installed?
Please help me.I really want to research this mahjong project.
Before running npm update in the directory where you have your project, you should run npm install first to install all the required dependencies needed for the project to run.
So I advice to delete the node_modules directory that was created after you ran npm update, after which you can then run npm install. This should solve your issue.
Update: If you just want to try it online and not run it locally they've hosted a version on the web: http://gleitzman.com/apps/mahjong.
It's not your fault.
What you did was correct, but the project documentation needs to be updated. It's not a turn-key solution and you'll need to figure a few things out to get it working.
The error message is says it wants a mongo db instance, but you don't have one running. Try the mongodb home page or google for instructions. If you have docker it is pretty easy: docker run -it -p 27017:27017 mongo.
Even after spinning up mongodb I wasn't able to get the app to work locally. You could try contacting the repo maintainer for assistance. They may be happy to help given you've shown interest in their project.
Good Luck!

How to run a Node.JS app that is forked from github?

Before I say anything else, I am a complete noob to node.js and I just want to see what this web application looks like. I noticed this project at a hackathon and I wanted to test it out. They gave the github repo: https://github.com/android-fanatic/Web But I can't run it from my computer. I understand that I would need to use the command prompt and run it from my local server, but can someone give me step by step directions for installing the node.js app?
Again the link is:
https://github.com/android-fanatic/Web
Thanks in advance for any help! :)
Install Node.js
Clone the repository to somewhere on your hard drive
Open a command prompt and go to that directory
Type npm install to install any dependencies
Type npm start
???
PROFIT
The reason you can use npm start is because if you look inside of their package.json file you'll see a "start" option under "scripts". That command will execute when you type npm start.
Assuming you have node and npm installed on your system, you should be able to do:
npm install
npm start
The first command will install the node package dependencies and the second will run the server.
Note: I have never used this project, so my guess is based on looking at the repo alone.
The web application should be available at:
http://localhost:3000

Bootstrap: Can't get grunt to run the server

I downloaded the source code from getbootstrap.com and ran npm install, then grunt connect without any luck.
I see this in my terminal:
Running "connect:server" (connect) task
Started connect web server on 0.0.0.0:3000
But when I navigate over, all I see is this:
What have I missed? I feel I've missed something basic here but unsure why I'm not seeing anything at all?
In the Internet Protocol version 4 the address 0.0.0.0 is a non-routable meta-address used to designate an invalid, unknown or non applicable target.
Unfortunately,bootstrap doc is not build in grunt, you need to install Jekyll to run the web local.so you need install ruby first,and install gem second,then install jekyll,finally,use
jekyll serve
to run the local server.
watch the guide

Categories

Resources