GithubHelp home page GithubHelp logo

Installation Failure about grovepi HOT 16 CLOSED

dexterind avatar dexterind commented on August 15, 2024
Installation Failure

from grovepi.

Comments (16)

marcellobarile avatar marcellobarile commented on August 15, 2024

Hello CubicleJockey,
which version of "npm" and "node" do you have?
did you use some kind of tool or manager to install Node.js on the Raspi? (nvm or apt-get or something else)
could you please post the content of "/home/pi/GrovePi/Practice/npm-debug.log" on http://pastebin.com/ and also the command that you are using to install the module?

Thank you

from grovepi.

CubicleJockey avatar CubicleJockey commented on August 15, 2024

Hey. Thanks for getting back so quickly.

Sorry I am using a gist from github, since I didn't want to make any new accounts today.

But here are my repro steps: https://gist.github.com/CubicleJockey/3149fbd0db260b266b5b

Thank you for your time and effort.

from grovepi.

marcellobarile avatar marcellobarile commented on August 15, 2024

Okay, got it. I'll be back to you as soon as I understand what's happened on your side :-) stay tuned.

from grovepi.

marcellobarile avatar marcellobarile commented on August 15, 2024

I was looking through your logs and what seems to be strange is that you are trying to install the module inside your user's folder ("/pi/node_modules", is that the correct Node.js modules path?). Could you try to install the module inside your application's folder OR globally thanks to the "-g" argument? (es: $ npm install -g node-grovepi)

BTW, the error is related to the i2c module, which is a dependency of our module.

I look forward to your reply.

from grovepi.

marcellobarile avatar marcellobarile commented on August 15, 2024

Okay, I probably got it... looking here kelly/node-i2c#55 seems like we need to update the dependency to fully support the latest Node.js version.

Until we patch it, I suggest you to install i2c separately and then proceed with the installation.

Let me know if this helped you.

Edit: in order to complete the trouble shooting, could you tell me which model of RaspberryPi do you have?

from grovepi.

CubicleJockey avatar CubicleJockey commented on August 15, 2024

Hi,

I see a lot of discovery happened before I could get back here today. Thanks for the effort.

Raspberry Pi Model: Pi 2 Model B

I also have a Model B Revision 2.0 Mounting holes, I could load up a fresh Raspian and try there as well.

from grovepi.

marcellobarile avatar marcellobarile commented on August 15, 2024

as far as I read, it seems that the 0.12.0 version is still only available for the Pi 2 Model (from the official repository) and our package.json contains an older version of the i2c module, which is not compatible with that version of Node.js; that's why you are facing troubles.

As said before, you can try to install the latest version of the i2c module separately and then continue to install the node-grovepi module. If necessary, you can also change your local package.json in order to download the latest version of the i2c module.

Let me know.

Best regards

from grovepi.

CubicleJockey avatar CubicleJockey commented on August 15, 2024

@marcellobarile alright so I haven't tested running it yet but this got me to build without error. I am being explicit with steps for others who may find this.

  1. sudo npm install GrovePi
  2. sudo npm install i2c -g (currenly version 2.1)
  3. cd GrovePi/Software/NodeJs/
  4. sudo nano package.json
  5. "dependencies": {
    "i2c": "0.1.6", <---- change to version 0.2.1
  6. ctrl + x, and Y to save
  7. sudo npm install -g
  8. After installation completes you will see the library listed as:
    [email protected] /usr/local/lib/node_modules/node-grovepi
    - [email protected]
    - [email protected]
    [email protected] ([email protected], [email protected], [email protected])
    - [email protected]
    - [email protected] ([email protected])
    - [email protected] ([email protected], [email protected], [email protected], [email protected])

from grovepi.

CubicleJockey avatar CubicleJockey commented on August 15, 2024

@marcellobarile after that build I tried to run this script in a folder outside of the GrovePi/Software/NodeJS folder and in it but it says it can't find 'node-grovepi'. As you see from my previous post I did a sudo npm install -g to try and make it global.

(function(){
    'use strict';

    var grovepi = require('node-grovepi');

    grovepi.init({
        onInit: function callback(){
            grovepi.run([version(callback), light(callback)]);
        },
        onError: function(error){
            console.log(error);
        }
    });

    function version(callback){
        grovepi.version(function onVersion(response){
            console.log('Version'.concat(response));
            callback();
        })
    };

    function light(callback){
        var digitalPort = 4;
        grovepi.light(digitalPort, function onLight(response){
            console.log('Light'.concat(response));
            callback();
        });
    };
})()

After I get this error:

module.js:338
throw err;
^
Error: Cannot find module 'node-grovepi'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at /home/pi/grovepi-starterkit-examples/NodeJS/blinkyLed.js:4:16
at Object. (/home/pi/grovepi-starterkit-examples/NodeJS/blinkyLed.js:29:3)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)

I went to double check what npm modules are installed so I ran npm ls.

Result is:

/home/pi
├── UNMET DEPENDENCY npm-debug.log@*
└── [email protected]

npm ERR! missing: npm-debug.log@*, required by undefined@undefined

I am guessing that work around isn't quite able to install properly even though it didn't complete after changing the version to 2.1.

NOTE: I am a totally noob to raspberry pi and linux. I am a native .NET, Web technologies dude, so sorry if some of the issues seem obvious.

from grovepi.

marcellobarile avatar marcellobarile commented on August 15, 2024

Hi @CubicleJockey, could you try to perform a "npm list" inside your Node.js app's folder?

Edit: you did "sudo npm install -g" but did you also add the node-grovepi dependency to your package.json file? It would be nice if I could see your app's folder.

from grovepi.

marcellobarile avatar marcellobarile commented on August 15, 2024

Hello @CubicleJockey, how is going with your issue? Did you find a way out?

from grovepi.

CubicleJockey avatar CubicleJockey commented on August 15, 2024

Hey sorry I got super distracted. My company shipped me over to take over a
coworkers spot who quit suddenly at Microsoft so I have been swamped. No I
haven't quite figured anything out yet but I haven't had time either. I'll
let you know if I do. Thanks.

On Wed, Apr 8, 2015 at 1:41 PM Marcello Barile [email protected]
wrote:

Hello @CubicleJockey https://github.com/CubicleJockey, how is going
with your issue? Did you find a way out?


Reply to this email directly or view it on GitHub
#86 (comment).

from grovepi.

marcellobarile avatar marcellobarile commented on August 15, 2024

okay, as last chance, I suggest you to install a previous version of Node (v0.10.25 works fine with the I2C dependant module). You can find all the necessary procedure here: http://raspberryalphaomega.org.uk/2014/06/11/installing-and-using-node-js-on-raspberry-pi/

I'll update the issue as soon as I get better news regarding the 0.12 Node.js version.

Enjoy!

from grovepi.

CubicleJockey avatar CubicleJockey commented on August 15, 2024

Awesome. Thank you for your support. Top Notch!

On Wed, Apr 8, 2015 at 3:47 PM Marcello Barile [email protected]
wrote:

okay, as last chance, I suggest you to install a previous version of Node
(v0.10.25 works fine with the I2C dependant module). You can find all the
necessary procedure here:
http://raspberryalphaomega.org.uk/2014/06/11/installing-and-using-node-js-on-raspberry-pi/

I'll update the issue as soon as I got better news regarding the 0.12
Node.js version.

Enjoy!


Reply to this email directly or view it on GitHub
#86 (comment).

from grovepi.

marcellobarile avatar marcellobarile commented on August 15, 2024

Hi @CubicleJockey , there is a new version of the node-grovepi module and you can find more info here: https://www.npmjs.com/package/node-grovepi
Please, note that it has been refactored and it will break your application if you switch from the v1.* to the v2.* ... on the other hand, it fully supports the latest version of Node.js

Enjoy!

from grovepi.

CubicleJockey avatar CubicleJockey commented on August 15, 2024

Thank you for the update. I am excited that the latest version is
available. But now I am conflicted betwee C# with the Win10 IOT on
Raspberry Pi 2 or try and work it out with NodeJS. Ahhh Choices. I may just
have to get multiple memory cards and build anything I build in both. :)

Cheers and thanks for the update.

On Wed, Jun 24, 2015 at 6:50 AM Marcello Barile [email protected]
wrote:

Hi @CubicleJockey https://github.com/CubicleJockey , there is a new
version of the node-grovepi module and you can find more info here:
https://www.npmjs.com/package/node-grovepi
Please, note that it has been refactored and it will break your
application if you switch from the v1.* to the v2.* ... on the other hand,
it fully supports the latest version of Node.js

Enjoy!


Reply to this email directly or view it on GitHub
#86 (comment).

from grovepi.

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.