CoffeeScript: No output after installation - coffeescript

I'm running Ubuntu 13.04, after installing using:
$ sudo npm install -g coffee-script
..with output..
npm http GET https://registry.npmjs.org/coffee-script
npm http 304 https://registry.npmjs.org/coffee-script
/usr/local/bin/coffee -> /usr/local/lib/node_modules/coffee-script/bin/coffee
/usr/local/bin/cake -> /usr/local/lib/node_modules/coffee-script/bin/cake
coffee-script#1.6.3 /usr/local/lib/node_modules/coffee-script
No commands yields any result, whatsoever:
$ coffee js.coffee
$ coffee -v
$ coffee GiveMeSomeCoffeePlease
I verified that it exists:
$ which coffee
/usr/local/bin/coffee
And the file has some contents:
$ cat `which coffee`
#!/usr/bin/env node
var path = require('path');
var fs = require('fs');
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
require(lib + '/coffee-script/command').run();
Also tried version 1.6.1 which works on my laptop. No difference on this computer though. Any ideas?

I finally found the solution. I had installed the package node on Ubuntu, which is something entirely different:
Amateur Packet Radio Node program (transitional package) The
existing node package has been renamed to ax25-node. This transitional
package exists to ease the upgrade path for existing users.
I went ahead and installed the nodejs package. But seems it didn't quite create the right binding anyway, I could run nodejs but not node. So I made an alias for it and now CoffeeScript is running just fine!
cd /usr/bin; sudo ln -s nodejs node

Same here .. In my expressjs app, instead of running via
node app
now it seems I have to run it via
nodejs app
I ll either create an alias or a symlink like Mika did. I am using Ubuntu 13.10 fyi.

Related

cannot install magento2.4 rom command line on Centos7

PHP7.4 + Nginx + Mysql are all installed.
Elasticsearch is already installed.
Downloaded the Magento 2.4 source code, magento-ce-2.4.0_sample_data-2020-07-26-02-51-57.tar.gz, unpacked it, and installed it on the command line with the following error.
[max#192 m24]$ ./bin/magento setup:install --base-url=http://mag.dev/ \
--db-host=localhost --db-name=magento --db-user=magento --db-password=hdqQP5%aBus3
--admin-firstname=Magento --admin-lastname=User --admin-email=user#example.com
--admin-user=admin --admin-password=admin123 --language=en_US
--currency=USD --timezone=America/Chicago --use-rewrites=1
--search-engine=elasticsearch7 --elasticsearch-host=192.168.10.46:8080
--elasticsearch-port=9200
Class Magento\Framework\App\ResourceConnection\Proxy does not exist
Try "bin/magento setup:di:compile" command

Setting up ERP-next in Mac

I have followed the GitHub to setup. I have installed pip, MariaDB, bench, Redis.
After I run the command bench init frappe-bench and cd frappe-bench I don't allow me to create a new site. The following is an error that IO encountered.
/usr/local/Cellar/python/3.7.5/bin/python3.7: Error while finding module specification for 'frappe.utils.bench_helper' (ModuleNotFoundError: No module named 'frappe')
Usage: bench [OPTIONS] COMMAND [ARGS]...
Try "bench --help" for help.
Error: No such command "new-site".
I have also changed in my.conf to
[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4
After bench init frappe-bench
cd env
source env/bin/activate
pip install -e ./apps/frappe --no-cache-dir
bench build
Reference: https://discuss.erpnext.com/t/mac-os-setup-failed/53422/3

How can I build the tutorials from the source distribution of postgresql?

I am trying to build and then learn from PostgreSQL's tutorials under the source distribution's postgresql-10.4/src/tutorial:
$ make
You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
make: *** No targets. Stop.
So
$ sudo apt install libpq-dev
But still
$ make
Makefile:27: /usr/lib/postgresql/10/lib/pgxs/src/makefiles/pgxs.mk: No such file or directory
make: *** No rule to make target '/usr/lib/postgresql/10/lib/pgxs/src/makefiles/pgxs.mk'. Stop.
which is indeed true:
$ ls /usr/lib/postgresql/10/lib/
adminpack.so cyrillic_and_mic.so fuzzystrmatch.so passwordcheck.so plpgsql.so unaccent.so utf8_and_iso8859.so
amcheck.so dblink.so hstore.so pg_buffercache.so postgres_fdw.so utf8_and_ascii.so utf8_and_johab.so
ascii_and_mic.so dict_int.so insert_username.so pgcrypto.so refint.so utf8_and_big5.so utf8_and_sjis2004.so
auth_delay.so dict_snowball.so _int.so pg_freespacemap.so seg.so utf8_and_cyrillic.so utf8_and_sjis.so
auto_explain.so dict_xsyn.so isn.so pgoutput.so sepgsql.so utf8_and_euc2004.so utf8_and_uhc.so
autoinc.so earthdistance.so latin2_and_win1250.so pg_prewarm.so sslinfo.so utf8_and_euc_cn.so utf8_and_win.so
bloom.so euc2004_sjis2004.so latin_and_mic.so pgrowlocks.so tablefunc.so utf8_and_euc_jp.so uuid-ossp.so
btree_gin.so euc_cn_and_mic.so libpqwalreceiver.so pg_stat_statements.so tcn.so utf8_and_euc_kr.so
btree_gist.so euc_jp_and_sjis.so lo.so pgstattuple.so test_decoding.so utf8_and_euc_tw.so
chkpass.so euc_kr_and_mic.so ltree.so pg_trgm.so timetravel.so utf8_and_gb18030.so
citext.so euc_tw_and_big5.so moddatetime.so pg_visibility.so tsm_system_rows.so utf8_and_gbk.so
cube.so file_fdw.so pageinspect.so pgxml.so tsm_system_time.so utf8_and_iso8859_1.so
I was wondering how I can compile the tutorials? Thanks.
Note that:
$ psql --version
psql (PostgreSQL) 10.4 (Ubuntu 10.4-0ubuntu0.18.04)
The extension development infrastructure PGXS should be in the server development package:
apt-get install postgresql-server-dev-10

uWSGI + virtualenv 'No module named site'

So this seems to be a really common problem with this setup, but I can't find any solutions that work on SO. I've setup a very new Ubuntu 15.04 server, then installed nginx, virtualenv (and -wrapper), and uWSGI (via apt-get, so globally, not inside the virtualenv).
My virtualenv is located at /root/Env/example. Inside of the virtualenv, I installed Django, then at /srv/www/example/app ran Django's startproject command with the project name example, so I have vaguely this structure:
-root
-Env
-example
-bin
-lib
-srv
-www
-example
-app
-example
manage.py
-example
wsgi.py
...
My example.ini file for uWSGI looks like this:
[uwsgi]
project = example
plugin = python
chdir = /srv/www/example/app/example
home = /root/Env/example
module = example.wsgi:application
master = true
processes = 5
socket = /run/uwsgi/app/example/example.socket
chmod-socket = 664
uid = www-data
gid = www-data
vacuum = true
But no matter whether I run this via uwsgi --ini /etc/uwsgi/apps-enabled/example.ini or via daemon, I get the exact same error:
Python version: 2.7.9 (default, Apr 2 2015, 15:37:21) [GCC 4.9.2]
Set PythonHome to /root/Env/example
ImportError: No module named site
I should note that the Django project works via the built-in development server ./manage.py runserver, and that when I remove home = /root/Env/example the thing works (but is obviously using the global Python and Django rather than the virtualenv versions, which means it's useless for a proper virtualenv setup).
Can anyone see some obvious path error that I'm not seeing? As far as I can tell, home is entirely correct based on my directory structure, and everything else in the ini too, so why is it not working with this ImportError?
In my case, I was seeing this issue because the django app I was trying to run was written in python 3 whereas uwsgi was configured for python 2. I fixed the problem by:
recompiling uwsgi to support both python 2 and python 3 apps
(I followed this guide)
adding this to my mydjangoproject_uwsgi.ini:
plugins = python35 # or whatever you specified while compiling uwsgi
For other folks using Django, you should also make sure you are correctly specifying the following:
# Django dir that contains manage.py
chdir = /var/www/project/myprojectname
# Django wsgi (myprojectname is the name of your top-level project)
module = myprojectname.wsgi:application
# the virtualenv you are using (full path)
home = /home/ubuntu/Env/mydjangovenv
plugins = python35
As #Freek said, site refers to a python module.
The error claims that python cannot find that package, which is because you have specified python_home to the wrong location.
I've encountered with the same problem and my uwsgi.ini is like below:
[uwsgi]
# variable
base = /home/xx/
# project settings
chdir = %(base)/
module = botservice.uwsgi:application
home = %(base)/env/bin
For this configuration uwsgi can find python executable in /env/bin but no packages could be found under this folder. So I changed home to
home = %(base)/env/
and it worked for me.
In your case, I suggest digging into home directive and point it to a location which contains both python executable and packages.
The site module is in the root of django.
First check is to activate the virtualenv manually (source /root/Env/example/bin/activate, start python and import site). If that fails, pip install django.
Assuming that django is correctly installed in the virtualenv, make sure that uWSGI activates the virtualenv. Relevant uWSGI configuration directives:
plugins = python
virtualenv = /root/Env/example
and in case you have error importing example.wsgi:
pythonpath = /srv/www/example/app/example

running PostgreSQL client in C from Cygwin

I'm trying to build a very simple PostgreSQL client in C over Cygwin.
Here's what I've done so far:
I've downloaded the PostgreSQL source code version 9.1.2 (to match the same version that is running on my server)
I've configured and compiled the source code from Cygwin. The compilation seemed to go smoothly.
From what I can tell, the header files are in:
/cygdrive/c/workspace/src/postgresql-9.1.2/src/interfaces/libpq, and
/cygdrive/c/workspace/src/postgresql-9.1.2/src/include
The libraries are in:
/cygdrive/c/workspace/src/postgresql-9.1.2/src/interfaces/libpq
From here, I compiled and linked the client program using the makefile below:
testlibpq: testlibpq.c
gcc -o testlibpq -I /cygdrive/c/workspace/src/postgresql-9.1.2/src/interfaces/libpq -I /cygdrive/c/workspace/src/postgresql-9.1.2/src/include -L /cygdrive/c/workspace/src/postgresql-9.1.2/src/interfaces/libpq testlibpq.c -Bstatic -lpq
The compilation and the linking succeeded without errors or warnings.
However, when I try to run the program, I get the following error:
$ ./testlibpq
/cygdrive/c/Users/dleclair/Dropbox/denis/src/testlibpq/testlibpq.exe: error while loading shared libraries: cygpq.dll: cannot open shared object file: No such file or directory
I haven't figured out how to fix this. Any pointers would be greatly appreciated.
Oh, one more thing, I found the folder that cygpq.dll was sitting in and set my LD_LIBRARY_PATH to point to it but it still gave me the same result.
dleclair#dleclair-win7l ~/Dropbox/denis/src/testlibpq
$ ls /cygdrive/c/workspace/src/postgresql-9.1.2/src/interfaces/libpq
bcc32.mak encnames.o fe-connect.o fe-misc.o fe-protocol3.o ip.o libpq-events.c md5.c pgstrcasecmp.c pqsignal.c thread.o
blibpqdll.def exports.txt fe-exec.c fe-print.c fe-secure.c libpq.a libpq-events.h md5.o pgstrcasecmp.o pqsignal.h wchar.c
chklocale.c fe-auth.c fe-exec.o fe-print.o fe-secure.o libpq.rc.in libpq-events.o nls.mk po pqsignal.o wchar.o
chklocale.o fe-auth.h fe-lobj.c fe-protocol2.c inet_net_ntop.c libpqddll.def libpq-fe.h noblock.c pqexpbuffer.c pthread-win32.c win32.c
cygpq.dll fe-auth.o fe-lobj.o fe-protocol2.o inet_net_ntop.o libpq-dist.rc libpq-int.h noblock.o pqexpbuffer.h README win32.h
encnames.c fe-connect.c fe-misc.c fe-protocol3.c ip.c libpqdll.def Makefile pg_service.conf.sample pqexpbuffer.o thread.c win32.mak
dleclair#dleclair-win7l ~/Dropbox/denis/src/testlibpq
$ echo $LD_LIBRARY_PATH
/cygdrive/c/workspace/src/postgresql-9.1.2/src/interfaces/libpq
dleclair#dleclair-win7l ~/Dropbox/denis/src/testlibpq
Normally on unix/linux systems after building the source a make install is done which copies the headers to standard locations like /usr/local/include and /usr/local/lib. You may have to do that on cygwin to to get the DLL in the search path.
Or you can just locate the DLL yourself and put it on the search path or in the same folder as your executable.