Saturday, 20 May 2017

p5 serialcontrol to Heroku

I am having some issues trying to get a example sketch on to Heroku. I have downloaded this from git hub https://github.com/vanevery/p5.serialcontrol/releases and I am using an arduino to send the data to the serial port. I have had success when just clicking on the index.html file(I am using the read count example), the web page appears and the data comes through fine. But I wanted to upload this to Heroku so I can see it anywhere in the world(I have a sensor project to use instead when i have accomplished this part). I am very new to node.js and have done some basic research on heroku and node.js but I think this might be beyond me to achive without some advice. My question is really what needs changing in order to get this example on Heroku e.g json file and Procfile, and specifically which files need to be sent to Heroku all of the serialcontrol file or just the example file?

Here were my steps:

-Make new app on Heroku

-CMD line heroku login

-cd to my project file (not sure if I am including the right files)

-Make Procfile (web: node sketch.js)

-Make json file (Also this may be my problem)

-git init

-heroku git:remote -a (projectname)

-git add .

-git commit -am "make it better"

-git push heroku master

Here is the most recent error I got when i tried to upload.

remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NPM_CONFIG_PRODUCTION=true
remote:        NODE_VERBOSE=false
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote:        engines.node (package.json):  unspecified
remote:        engines.npm (package.json):   unspecified (use default)
remote:
remote:        Resolving node version 6.x via semver.io...
remote:        Downloading and installing node 6.10.3...
remote:        Using default npm version: 3.10.10
remote:
remote: -----> Restoring cache
remote:        Skipping cache restore (new-signature)
remote:
remote: -----> Building dependencies
remote:        Prebuild detected (node_modules already exists)
remote:        Rebuilding any native modules
remote:
remote:        > bufferutil@1.2.1 install 
 /tmp/build_b64f3f61214493426a26b6776d286c6a/node_modules/ws/node_modules/
bufferutil
remote:        > node-gyp rebuild
remote:
remote:        make: Entering directory 
 '/tmp/build_b64f3f61214493426a26b6776d286c6a/node_modules/ws/node_modules/
bufferutil
remote:        CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
remote:        SOLINK_MODULE(target) Release/obj.target/bufferutil.node
remote:        COPY Release/bufferutil.node
remote:        make: Leaving directory 
'/tmp/build_b64f3f61214493426a26b6776d286c6a/node_modules/ws/node_modules/
bufferutil/build'
remote:
remote:        > utf-8-validate@1.2.1 install 
/tmp/build_b64f3f61214493426a26b6776d286c6a/node_modules/ws/node_modules/
utf-8-validate
remote:        > node-gyp rebuild
remote:
remote:        make: Entering directory 
'/tmp/build_b64f3f61214493426a26b6776d286c6a/node_modules/ws/node_modules/
utf-8-validate/build'
remote:        CXX(target) Release/obj.target/validation/src/validation.o
remote:        SOLINK_MODULE(target) Release/obj.target/validation.node
remote:        COPY Release/validation.node
remote:        make: Leaving directory 
'/tmp/build_b64f3f61214493426a26b6776d286c6a/node_modules/ws/node_modules/
utf-8-validate/build'
remote:
remote:        > serialport@3.1.2 install 
/tmp/build_b64f3f61214493426a26b6776d286c6a/node_modules/serialport
remote:        > node-pre-gyp install --fallback-to-build
remote:
remote:        sh: 1: node-pre-gyp: not found
remote:
remote:        npm ERR! Linux 3.13.0-112-generic
remote:        npm ERR! argv 
"/tmp/build_b64f3f61214493426a26b6776d286c6a/.heroku/node/bin/node" 
"/tmp/build_b64f3f61214493426a26b6776d286c6a/.heroku/node/bin/npm" "rebuild"
remote:        npm ERR! node v6.10.3
remote:        npm ERR! npm  v3.10.10
remote:        npm ERR! file sh
remote:        npm ERR! code ELIFECYCLE
remote:        npm ERR! errno ENOENT
remote:        npm ERR! syscall spawn
remote:        npm ERR! serialport@3.1.2 install: `node-pre-gyp install --
fallback-to-build`
remote:        npm ERR! spawn ENOENT
remote:        npm ERR!
remote:        npm ERR! Failed at the serialport@3.1.2 install script 'node-
pre-gyp install --fallback-to-build'.
remote:        npm ERR! Make sure you have the latest version of node.js and 
npm installed.
remote:        npm ERR! If you do, this is most likely a problem with the 
serialport package,
remote:        npm ERR! not with npm itself.
remote:        npm ERR! Tell the author that this fails on your system:
remote:        npm ERR!     node-pre-gyp install --fallback-to-build
remote:        npm ERR! You can get information on how to open an issue for 
this project with:
remote:        npm ERR!     npm bugs serialport
remote:        npm ERR! Or if that isn't available, you can get their info 
via:
remote:        npm ERR!     npm owner ls serialport
remote:        npm ERR! There is likely additional logging output above.
remote:
remote:        npm ERR! Please include the following file with any support 
request:
remote:        npm ERR!     /tmp/build_b64f3f61214493426a26b6776d286c6a/npm-
debug.log
remote:
remote: -----> Build failed
remote:
remote:        We're sorry this build is failing! You can troubleshoot 
common issues here:
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-
deploys
remote:
remote:        Some possible problems:
remote:
remote:        - node_modules checked into source control
remote:        https://blog.heroku.com/node-habits-2016#9-only-git-the-
important-bits
remote:
remote:        - Node version not specified in package.json
remote:        https://devcenter.heroku.com/articles/nodejs-
support#specifying-a-node-js-version
remote:
remote:        Love,
remote:        Heroku
remote:
remote:  !     Push rejected, failed to compile Node.js app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to addingserverthistime.
remote:



via Ll N

No comments:

Post a Comment