Plain installation of current version of Wekan on Ubuntu? - node.js

Wekan is an open-source Kanban Board which used to be easy to install using nodejs (given that you already set up your MongoDB). I am stumbling upon the actual installation steps of the guide to install Wekan on Ubuntu 16.04:
Download the latest version wekan source code using the wget command and extract it.
wget https://github.com/wekan/wekan/releases/download/v0.63/wekan-0.63.tar.gz
tar xf wekan-0.63.tar.gz
And you will get a new directory named bundle. Go to that directory and install the Wekan dependencies using the npm command as shown below.
cd bundle/programs/server
npm install
Figuring out the last stable version is easy, there are new stable versions nearly every day (as of March 2019), which somehow seem to contradict the common definition.
More importantly, the directory bundle/programs/server does not exist, only server, but it does not contain a main.js which would be necessary to run
node main.js
Other resources considered:
I did of course check the official documentation, but it looks not up-to-date. The page https://github.com/wekan/wekan/wiki/Install-and-Update is redirecting to a rather untidy page which does no longer talk about a standalone installation.
I prefer a minimal installation and not a solution using snap like described at computingforgeeks
There is also an unanswered question about a more specific installation around: Installing Wekan via Sandstorm on cPanel which follows a similar approach.

The latest releases on the Wekan page are actually no ready-to-use node builds.
Wekan is built using Meteor and you will need Meteor to create the build. This is because you could also build it using Meteor against other architectures than os.linux.x86_64.
So here is how to build the latest release as of today on your dev-machine to then deploy it:
Build it yourself
[1.] Install Meteor
curl https://install.meteor.com/ | sh
[2.] Download and extract the latest Wekan
wget https://github.com/wekan/wekan/archive/v2.48.tar.gz
tar xf wekan-2.48.tar.gz
cd wekan-2.48
[3.] Install Wekan Dependencies
./rebuild-wekan.sh
# use option 1
[4.] Install dependency Meteor packages
Now it gets dirty. Somehow the required packages are not included in the release (an issue should be opened at GH). You need to install them yourself:
# create packages dir
mkdir -p packages
cd packages
# clone packages
git clone git#github.com:wekan/wekan-ldap.git
git clone git#github.com:wekan/meteor-accounts-cas.git
git clone git#github.com:wekan/wekan-scrollbar.git
# install repo and extract packages
git clone git#github.com:wekan/meteor-accounts-oidc.git
mv meteor-accounts-oidc/packages/switch_accounts-oidc ./
mv meteor-accounts-oidc/packages/switch_oidc ./
rm -rf meteor-accounts-oidc/
cd ../
[5.] Build against your architecure
meteor build ../build --architecute os.linux.x86_64
# go grab a coffee... yes even with nvme SSD...
Once the build is ready you can go ../build and check out the wekan-2.48.tar.gz which now contains your built bundle including the described folders and files.
Use this bundle to deploy as described in the documentation.
Summary
This describes only how to create the build yourself and I am not giving any guarantee that the build package will run when deployed to your target environment.
I think there is either some issue with the way the releases are attached on GH or they explicitly want to keep it open against which arch you want to build.
In any case I would open an issue with demand for a more clear documentation and a description for reproduction of the errors your mentioned.
Further readings
https://guide.meteor.com/deployment.html#custom-deployment

Related

Workflow to checkout single node package for developing a patch / pull request

I want to add a feature to https://github.com/opentripplanner/otp-react-redux/ which is pulled in from the https://github.com/opentripplanner/otp-ui/tree/master/packages/geocoder package (add another geocoder).
Coming from the PHP world and composer, I normally do in such cases
composer install
rm -r vendor/foo/bar
composer install --prefer-source
cd vendor/foo/bar
git remote set-url origin <myforkURL>
git checkout main
Now I can easily edit that package in-place and make a pull request.
My question is: Is there a similar work-flow possible for node packages using yarn?
I already tried
yarn add "#opentripplanner/geocoder#master"
but no .git folder appeared in otp-react-redux/node_modules/#opentripplanner or otp-react-redux/node_modules/#opentripplanner/geocoder
Also it looks like that multiple packages are created from the #opentripplanner repo, which might complicate things.
I could try to simply edit the files in node_modules and then copy them to the a manually checked-out git repository, but when running yarn start everything is also overwritten.
EDIT: As the packages come from a monorepo I tried to delete all the #opentripplanner lines from packages.json and added:
yarn add opentripplanner/otp-ui#main
This now causes the build to fail.
I noticed, that the base package.json requires different package versions from the monorepo, so it will not work to require the complete the full main branch.
EDIT2: I found some clue here:
https://github.com/opentripplanner/otp-ui#development
but that also caused dependencies to not resolve properly.
EDIT3: yarn link actually looked promissing:
cd ..
git clone https://github.com/opentripplanner/otp-ui
cd otp-ui/packages/geocoder
yarn link
Now in the main project code (otp-react-redux)
yarn link "#opentripplanner/geocoder"
This creates a symlink in the node_modules folder to the specific folder in the monorepo I have cloned.
Unfortunately the build does not work:
Module not found: Can't resolve '#opentripplanner/geocoder' in 'otp-react-redux/lib/actions'
I even tried to match the version which is used in the main project by checking out the revision of 1.2.1
yarn link does the job!
cd ..
git clone https://github.com/opentripplanner/otp-ui
cd otp-ui
yarn
cd packages/geocoder
yarn link
Now in the main project code (otp-react-redux)
yarn link "#opentripplanner/geocoder"
This creates a symlink in the node_modules folder to the specific folder in the monorepo I have cloned.
To make the build work, the important part is that we run yarn in the monorepo before!
EDIT: Unfortunately the link process needs to be repeated for each of the #opentripplanner modules which require geocoder:
cd node_modules
$ find -name geocoder -type d
./trip-details/node_modules/#opentripplanner/geocoder
./vehicle-rental-overlay/node_modules/#opentripplanner/geocoder
./transitive-overlay/node_modules/#opentripplanner/geocoder
./endpoints-overlay/node_modules/#opentripplanner/geocoder
./zoom-based-markers/node_modules/#opentripplanner/geocoder
./trip-viewer-overlay/node_modules/#opentripplanner/geocoder
./trip-form/node_modules/#opentripplanner/geocoder
./transit-vehicle-overlay/node_modules/#opentripplanner/geocoder
./itinerary-body/node_modules/#opentripplanner/geocoder
./icons/node_modules/#opentripplanner/geocoder
./route-viewer-overlay/node_modules/#opentripplanner/geocoder
./printable-itinerary/node_modules/#opentripplanner/geocoder
./stop-viewer-overlay/node_modules/#opentripplanner/geocoder
./stops-overlay/node_modules/#opentripplanner/geocoder
./location-field/node_modules/#opentripplanner/geocoder
./park-and-ride-overlay/node_modules/#opentripplanner/geocoder
cd trip-details
yarn link "#opentripplanner/geocoder"
repeat for each of them until they are all links:
otp-react-redux$ find node_modules/ -name geocoder -type l
node_modules/#opentripplanner/trip-details/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/vehicle-rental-overlay/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/transitive-overlay/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/endpoints-overlay/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/zoom-based-markers/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/trip-viewer-overlay/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/trip-form/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/transit-vehicle-overlay/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/itinerary-body/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/icons/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/route-viewer-overlay/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/printable-itinerary/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/stop-viewer-overlay/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/stops-overlay/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/location-field/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/park-and-ride-overlay/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/base-map/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/geocoder
yalc seems a good solution for this kind of problem
cd ~/projects/otp-ui/packages/itinerary-body
yarn tsc
yalc publish
cd ~/projects/otp-react-redux
yalc link #opentripplanner/itinerary-body
Now each time you change something in the package:
cd ~/projects/otp-ui/packages/itinerary-body
yarn tsc && yalc publish
cd ~/projects/otp-react-redux
yalc update
yarn start

How to run npm webpack vue project on both Windows and Mac?

I took a Vue 2 online course and it did show (but didn't really explain) how to install node.js, npm and vue. Currently using vue-cli to set up my project using vue init webpack-simple. Problem is I have a Windows desktop and a Mac laptop. I'm using Box cloud on both but I need to have 2 separate folders for the same project. Basically, project-1-windows and project-1-mac.
I can't run npm run dev on the project-1-mac while on Windows 10 and vice versa. The only way I know to run both is to delete the node_modules folder and run npm install. However it takes a while for the files to download. Is there an easier way to do this?
It looks like you want either GitHub/BitBucket/friends or (for much more complex set-ups) Docker.
I will explain only the first (easier) option. To set-up docker, you rather go to its docks.
So, for GitHub/BitBucket/friends way, you need some one-time set-up (you have to do all of this in terminal of your machine. I don't go too deep into details because you may find corresponding docks for each thing easily by googling it).
Install git if needed on both machines. On mac, you just run git --version in terminal. It'll either show the version of installed git or will ask if you want to install git together with other developer tools.
Install brew on Mac, install any of these on Windows. These are just package managers. Use them to install nvm.
Install nvm (it's node version manager, arguably the most convenient way to manage node.js installations) on both machines.
Use nvm to install node.js (npm comes bundled with it) on both machines. That's it! One-time set-up done. Run node -v && npm -v to check that both are installed.
Now, to start each project you would do the following:
Create a repo (which is like a folder but on GitHub/BitBucket server) that you may freely access from any device that has internet connection.
Start project on any of your machines with something like npm init or vue init webpack-simple or whatever you feel comfortable with.
Run git init
When you do changes, commit & push them into your online repo.
Avoid committing files that might be auto-regenerated, they simply don't worth storing.
You may use any npm commands.
When you want to continue working on another machine, simply git clone your existing repo, run npm install and you are done.
Commit changes if needed.
git pull changes to another device if needed

Npm install doesn't download dependency assets from Git LFS on Ubuntu

Background
I have a project that's split into several smaller projects with one main project that downloads the others as dependencies of the main project.
I'm using Gitlab to host my projects in private repositories, using deploy tokens to allow npm install to download them.
The dependencies are added to the main project using the following format in package.json:
git+https://name:token#gitlab.com/group/project.git
Problem
On Windows when I do a git clone of my main project and run npm install, it does download all the assets using Git LFS, but on Ubuntu the assets aren't getting downloaded. If I check the contents of all the files tracked by Git LFS all I get is the information Git LFS placeholder. I'm using identical commands and software versions on Windows and Ubuntu, but with different results.
I've tried:
Updating to same versions of Node(10.16.0) and Npm(6.10.2) on both Windows and Ubuntu
Updating to the latest versions of Node and Npm (I had to stick to version 10.x for Node because of some dependencies not working with 12.x)
Adding a .lfsconfig file that points to the repository as described in the following issue: https://github.com/npm/npm/issues/11151
Updating Git to the latest version (2.21 on Windows and 2.22 on Ubuntu)
Current workaround
Currently I'm cloning the main project then manually cloning my dependencies into node_modules so that they're all proper git repositories so that I can then use git lfs pull in them. It works, but it's not how it should work, especially not since it's working as it should on Windows.
Question
Why is npm install handling Git LFS differently for dependencies on Ubuntu vs Windows? How do I get npm install to work properly with Git LFS on dependencies, is there a settings somewhere I need to change to e.g. enforce Git LFS downloading?
Step 1. Inside of your repository, run the following command and then commit the resulting .gitconfig and push:
$ git config -f .gitconfig lfs.url https://gitlab.com/group/project.git/info/lfs
Step 2. In the directory in which you want to npm install your project, run for example:
$ npm install -S https://gitlab.com/group/project.git

npm install without symlinks option not working

I setup a development environment with Windows 8 and Ubuntu as a virtual machine. For that I use VirtualBox.
I also manage to create a shared folder in VirtualBox.
In this shared folder I try to start a project with ember-generator of Yeoman.
yo ember --skip-install --karma
npm install --no-bin-links
For installing modules NPM I use the option "--no-bin-links" not to create symbolic links. Unfortunately, I still have errors creations symbolic links ... Is what I use although this option ? There he has a bug ?
The NPM docs about parameter "--no-bin-links" say:
will prevent npm from creating symlinks for any binaries the package
might contain.
Which will just cause NPM to not create links in the node_modules/.bin folder. I also searched for a way to prevent NPM from creating symlinks when using npm install ../myPackage, but can't find any solution...
Update: The npm support team said this will reproduce the old behaviour (no symbolic links):
npm install $(npm pack <folder> | tail -1)
Works for me in git-bash on Windows 10.
This Stack Overflow page comes up in Google search results when trying to solve the issue of installing local modules (ie. npm install ../myPackage) and not wanting symbolic links. So I'm adding this answer below to help others who end up here.
Solution #1 - For development environment.
Using the solution proposed by the NPM support team as mentioned in the other answer works...
# Reproduces the old behavior of hard copies and not symlinks
npm install $(npm pack <folder> | tail -1)
This is fine in the development environment for manual installs.
Solution #2 - For build environment.
However, in our case, the development environment doesn't quite matter as much though because when committing our changes to Git, the ./node_modules/ folder is ignored anyway.
The files ./package.json and ./package-lock.json is what is important and is carried into our build environment.
In our build environment (part of our automated CI/CD pipeline), the automation just runs the npm install command and builds from the dependencies listed in the package.json file.
So, here is where the problem affects us. The locally referenced files in the dependencies list of the package.json causes symlinks to appear. Now we are back to the old problem. These symlinks then get carried into the build's output which move onto the Stage and Production environments.
What we did instead is use rsync in archive mode with the --copy-links option that turns symbolic links into copies of the original.
Here is what the command looks like in the automated build:
# Install dependencies based on ./package.json
npm install
# Make a copy that changes symlinks to hard copies
rsync --archive --verbose --copy-links ./node_modules/ ./node_modules_cp/
# Remove and replace
rm -r ./node_modules/
mv ./node_modules_cp/ ./node_modules/
I have a similar environment. Apparently the Virtualbox (vagrant) synchronisation has problems when renaming or moving files, which happens when updating modules.
If you do a file listing (ls -alhp) on the command line and see ??? for the file permissions, then it is time to reboot your virtualbox. This will set the permissions to valid values. Then use the --no-bin-links option when installing a module.

Where should I install node.js?

I'm wondering in which directory I should go to install node.js on a CentOS 5/cPanel server by executing the following commands mentioned in the Wiki:
git clone --depth 1 https://github.com/joyent/node.git
cd node
git checkout origin/v0.4 # optional. Note that master is unstable.
export JOBS=2 # optional, sets number of parallel commands.
mkdir ~/local
./configure --prefix=$HOME/local/node
make
make install
echo 'export PATH=$HOME/local/node/bin:$PATH' >> ~/.profile
source ~/.profile
Please advise.
The more conventional locations for a multi-user system are:
/usr/bin/node
/usr/local/bin/node
But as #Raynos stated you can put it wherever you want to.
I like to install latest version of node.js using something called nvm.
Like Raynos said you are better of using node v0.4.8 instead of development branch to avoid broken packages.

Resources