How to deploy vue-cli and node.js on the server?



Decided to install it on your server 
>  Server Linux 3.16.0-8-amd64 #1 SMP Debian 3.16.64-2 (2019-04-01) x86\_64 GNU/Linux

 project to node js using vue.   

Npm(1.4.21) was installed and running, Node is(v0.10.29).   

Team 
> npm install -g vue-cli

 set vue  

When you try to run the command `init vue webpage` , the server responds  

```
root@server:/var/www/vue# init vue webpage
/usr/local/lib/node_modules/vue-cli/bin/vue-init:35
program.on('--help', () => {
^
SyntaxError: Unexpected token )
 at Module._compile (module.js:439:25)
 at Object.Module._extensions..js (module.js:474:10)
 at Module.load (module.js:356:32)
 at Function.Module._load (module.js:312:12)
 at Function.Module.runMain (module.js:497:10)
 at startup (node.js:119:16)
 at node.js:906:3
```
  

Probably the problem is that he does not understand the syntax of the TC performs its not like js.  

 How to solve?
Apparently you have a version of NodeJS that does not understand the new features of ES6+, update.  

Way to put on the server, NodeJS and VueCLI at least strange.
From the official Node.js documentation:



> 
> A Node.js package is also available in the official repo for Debian Sid (unstable), Jessie (testing) and Wheezy (wheezy-backports) as “nodejs”. **It only installs a nodejs binary.**
> 
> 
> 


So, if you only type `sudo apt-get install nodejs` , it does not install other goodies such as **npm**. 


You need to type:



```
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs

```


> 
> Optional: install build tools
> 
> 
> To compile and install native add-ons from npm you may also need to install build tools:
> 
> 
> 



```
sudo apt-get install -y build-essential

```

More info: [Docs](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions-enterprise-linux-fedora-and-snap-packages) save a copy of your current jetson’s “/proc/config.gz”. start with that. you do need to learn to cross compile to build a kernel for the tx1, but you can just get the kernel source here (you don’t need to use git)…be sure your current release matches the kernel source:

[https://developer.nvidia.com/…](https://developer.nvidia.com/embedded/linux-tegra-archive) hi,

do you have joy package installed with all necessary packages/dependencies ?

try to search for joy\_node or run joy package examples to find out what is going wrong. i seem to have fixed this by myself. i disabled probe on my .vcl and this seemed to fix the 503 issues. here is my .vcl for varnish incase anyone needs it(this might work for you)! :slight\_smile:

vcl 4.0;

backend default {

.host = "127.0.0.1";

.port = "81";

.connect\_timeout = 5s;

.… was caused because there was an "unhandled rejection error: eacces: permission denied, mkdir '/home//.npm/\_cache/index-<…>/

solved problem by just adding “sudo” in front

sudo npx create-react-app . hi yerhu,

i could imagine, that one of the two following scenarios may cause the issue:

you’re using an outdated version of tk-core. check in your configuration: core/core\_api.yml

you’re using a pipelineconfiguration, which is pointing to a local-path and includes a file like python\_interpreter, i… [image] andrei:

a quick fix is to comment the line in the "on message" tab for the function node that is troubled

when you add a module in "setup", the "import as" name is made available to the function tabs...

[image]

... so you dont need to declare it nor do you need to set/get it from co… Let's say in your `settings.py` file you have:



```
SITE_URL='www.mydomain.tld/somewhere/'
SITE_NAME='My site'

```

**If you need that in just one or two views:**



```
from django.shortcuts import render_to_response
from django.conf import settings

def my_view(request, ...):
    response_dict = {
        'site_name': settings.SITE_NAME,
        'site_url': settings.SITE_URL,
    }
    ...
    return render_to_response('my_template_dir/my_template.html', response_dict)

```

**If you need to access these across a lot of apps and/or views, you can write a context processor to save code:**


James has a tutorial on this 
[online](http://www.b-list.org/weblog/2006/jun/14/django-tips-template-context-processors/).


Some useful information on the when and if of context processors is available on this very site 
[here](https://stackoverflow.com/questions/831301/when-is-it-appropriate-to-use-django-context-processors).


Inside your `my_context_processors.py` file you would:



```
from django.conf import settings

def some_context_processor(request):
    my_dict = {
        'site_url': settings.SITE_URL,
        'site_name': settings.SITE_NAME,
    }

    return my_dict

```

Back in your `settings.py`, activate it by doing:



```
TEMPLATE_CONTEXT_PROCESSORS = (
    ...

    # yours
    'my_context_processors.some_context_processor',
)

```

In your `views.py`, make a view use it like so:



```
from django.shortcuts import render_to_response
from django.template import RequestContext

def my_view(request, ...):  
    response_dict = RequestContext(request)
    ...
    # you can still still add variables that specific only to this view
    response_dict['some_var_only_in_this_view'] = 42
    ...
    return render_to_response('my_template_dir/my_template.html', response_dict)

``` [image] paulaniculaesei:

but if i make from vs code a new branch , why i can’t open a pull request?

because you need to push the branch to somewhere public first. you can’t push your branch to someone else’s repository, so you need your own (a fork in github terms). Did you had ACS common installed in your AEM.

<https://adobe-consulting-services.github.io/acs-aem-commons/features/versioned-clientlibs/index.html>




[View solution in original post](/t5/adobe-experience-manager/aem-implementation-of-versioning-for-clientlibs-and-css/m-p/399346#M7116)