Code Monkey home page Code Monkey logo

Comments (13)

grandangelo avatar grandangelo commented on June 20, 2024 1

I cloned vue app repo, then extracted vue-app-dist in the same folder (I saw dist directory appear) and tried to start with
npm run build
The output I posted comes from this procedure.

I will try to extract in a clean folder, then run
npm run build

EDIT: sorry now I understand: just copy, no need for npm run.
Will try tomorrow and post results, thanks again.

from backend.

avivace avatar avivace commented on June 20, 2024

What do you see if you try to access localhost:5000?

You have to place a build of the Vue app in a folder called "dist".

As the readme specifies:

New Vue web application: localhost:5000/ (assuming a vue-app build is placed in the dist/ folder);

from backend.

grandangelo avatar grandangelo commented on June 20, 2024

Error is ERR_CONNECTION_REFUSED.

Following instruction to setup a vue-app (sorry did not noticed), after cloning repo:

pi@coderbot:~/vue-app $ npm install
npm ERR! Error: Method Not Allowed
npm ERR! at errorResponse (/usr/share/npm/lib/cache/add-named.js:260:10)
npm ERR! at /usr/share/npm/lib/cache/add-named.js:203:12
npm ERR! at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:167:7)
npm ERR! at FSReqWrap.oncomplete (fs.js:82:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>

npm ERR! System Linux 4.9.35-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi/vue-app
npm ERR! node -v v4.8.2
npm ERR! npm -v 1.4.21
npm ERR! code E405
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/vue-app/npm-debug.log
npm ERR! not ok code 0

from backend.

avivace avatar avivace commented on June 20, 2024

This is likely caused by a really old version of node/npm..

Are you trying to build the vue-app on the raspberry pi? This is discouraged and not supported, if you can, launch the build on another system then just move the dist folder on the raspberry.

However, you can find ready builds in the releases page of the vue-app repository, https://github.com/CoderBotOrg/vue-app/releases. Just download the more recent one and extract it, you should have the folder as if you built it yourself

from backend.

grandangelo avatar grandangelo commented on June 20, 2024

Downloaded vue-app-dist.tgz as suggested but

pi@coderbot:~/vue-app $ npm run build

[email protected] build /home/pi/vue-app
node build/build.js

module.js:339
throw err;
^

Error: Cannot find module 'chalk'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (/home/pi/vue-app/build/check-versions.js:2:15)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)

npm ERR! [email protected] build: node build/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is most likely a problem with the vue-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node build/build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls vue-app
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.9.35-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "run" "build"
npm ERR! cwd /home/pi/vue-app
npm ERR! node -v v4.8.2
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/vue-app/npm-debug.log
npm ERR! not ok code 0

I will try to compile on my machine. Thanks for support.

from backend.

avivace avatar avivace commented on June 20, 2024

Sorry, didn't make myself clear:
vue-app-dist.tgz already contains the built web application. Exract it and you should see a "dist" folder. Just move it in the backend folder and you're good to go.

if you want to manually build it, clone the vue-app repo and follow the instructions in the README (npm install, then npm run build)

from backend.

avivace avatar avivace commented on June 20, 2024

Exactly, the release contains the result of npm run build.

Let me know!

from backend.

grandangelo avatar grandangelo commented on June 20, 2024

I tried again but:

image

If I browse to http://localhost:5000/

image

Any hint?

from backend.

avivace avatar avivace commented on June 20, 2024

Try with coderbot.local

from backend.

grandangelo avatar grandangelo commented on June 20, 2024

I removed vue-app directory, created again and copied dist folder after fresh download of prebuilt binary.
Browsing to http://coderbot.local:5000 redirects to http://coderbot.local:5000/vue/index.html and returns this json:

{
  "detail": "The requested URL was not found on the server.  If you entered the URL manually please check your spelling and try again.",
  "status": 404,
  "title": "Not Found",
  "type": "about:blank"
}

from backend.

avivace avatar avivace commented on June 20, 2024

This happens when the webserver can't find the vue-app build.
Are you sure you have a "dist" folder alongside the init.py script? and that folder contains the vue-app build (an index.html and some other files) ?

from backend.

grandangelo avatar grandangelo commented on June 20, 2024

Ok it works. I had the dist folder in vue-app, not coderbot.
Thank you very much, closing this issue.

from backend.

avivace avatar avivace commented on June 20, 2024

Gotcha, glad you figured that out

from backend.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.