Coder Social home page Coder Social logo

Comments (3)

chuank avatar chuank commented on August 11, 2024

in your trace, you're using node v12.7.

use node v10.40 instead – spark-server as of current status only runs on node v10.

this should resolve issues with the ursa module.

https://community.particle.io/t/local-cloud-on-raspberry-pi/5708/69

from spark-server.

tenaciousRas avatar tenaciousRas commented on August 11, 2024

Several points for the Particle team:

  1. Is this documented somewhere? Chasing around different versions of NodeJS is a waste of time. A response in a bug report is not sufficient.
  2. Specify an engine in package.json and avoid this entire thread! http://blog.nodejitsu.com/package-dependencies-done-right/
  3. URSA versioning on Github is out-of-sync with NPM. How many other NPM packages like this?
  4. TDD
  5. NodeJS = fail. Java/Scala for the win.

from spark-server.

tenaciousRas avatar tenaciousRas commented on August 11, 2024

Actually, it will install and run under a newer version of NodeJS - just takes some TLC to make it work.

FWIW I've found it easiest to use "n" to switch between NodeJS versions. I've only tried the official repo and "n" versions of node. N makes it easy to switch versions.

I have spark-server running on NodeJS 4.2.2, NPM 2.14.7, Raspbian Wheezy. The keys to make this happen are this:
(optional) on an RPi I ran sudo rpi-update to update the RPi-v1 firmware. I basically followed the steps at https://github.com/Hexxeh/rpi-update, but I ran apt-get update and apt-get upgrade (sudo) first. Then the device was rebooted before proceeding.

  1. sudo apt-get update; sudo apt-get upgrade; sudo apt-get dist-upgrade (again, if just updated rpi firmware)
  2. sudo npm install -g n; n ls
  3. sudo n 4.2.2
  4. sudo apt-get install gcc-4.7 g++-4.7
  5. sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6
  6. sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.7
  7. sudo update-alternatives --config gcc
  8. choose gcc version 4.7
  9. verify installation: gcc --version; g++ --version

Now install spark-server with npm --verbose -g install spark-server. However, it will fail until you make these edits:

  • Edit dependency versions in spark-server/package.json
    -- modify "dependencies": "ursa": "", "when": "", "moment": "", "xtend": "", "request": "*"
    -- may also have to modify the stated version for express, ~3.4.4 works with this node/npm/node-gyp version

Also particle-cli installs and runs with this version of nodejs. To get this to happen I needed similar edits to package.json; and on Wheezy I built dfu-util from (github) source to obtain version 0.8.

FWIW - I'm not sure but I think the rumors/reports of problems with URSA and Crypto are due to V8 versions. NodeJS runs on V8. NodeJS v0.10 does not support ECMAScript6 because it only runs on an older V8 engine. NodeJS 0.12+ supports V8 engines with ECMA6 support. The V8V package is unreliable for investigating this.

They appear to run as they should, but !Proceed With Caution! I'm not 100% confident yet because I have to re-issue keys and reclaim photon.

Follow up: spark-server seems to work fine. BACKUP spark-server/user -- I ran into problems because I accidentally nuked it. Beware Express 4.x and node-oauth 2.x do not work in package.json without code-rework.

from spark-server.

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.