Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where do I have to save the index.js file? #27

Open
Rentex1 opened this issue Feb 2, 2019 · 7 comments
Open

Where do I have to save the index.js file? #27

Rentex1 opened this issue Feb 2, 2019 · 7 comments

Comments

@Rentex1
Copy link

Rentex1 commented Feb 2, 2019

Hi there!
I want to fly my Mambo with this package.
But when I run the index.js file an error appears and says:
internal/modules/cjs/loader.js:583
throw err;
^

Error: Cannot find module 'parrot-minidrone'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (/Users/Luis/Documents/GitHub/npm-parrot-minidrone/index.js:1:77)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)

Where do I have to save my index.js file that it works?
Pls Help

@fetherston
Copy link
Owner

It sounds like you may of had an error with a dependency while running npm install and the parriot-minidrone package never made it into your node_modules folder. Try using NVM to downgrade node to 6.2.2 and run npm install parrot-minidrone. That said, I'm having issues with noble's dependencies on Mojave now.

I may move this whole thing to docker as it's been difficult to maintain the dependencies this library uses.

@tyler-canton
Copy link

tyler-canton commented Feb 2, 2019 via email

@Rentex1
Copy link
Author

Rentex1 commented Feb 3, 2019 via email

@tyler-canton
Copy link

tyler-canton commented Feb 3, 2019 via email

@Rentex1
Copy link
Author

Rentex1 commented Feb 3, 2019

thanks now all my troubles with the permission are solved but now there are many errors which say:
warning: 'Int32Value' is deprecated: Use maybe version [-Wdeprecated-declarations] productId = info[1]->Int32Value();
This occurs when I run npm install parrot-minidrone.

And in my package.json file the description, repository field, license field and the Read.me data is missing. What do I have to add to my package.json file?

I am sorry for taking your time.
I am a total beginner in working with node.js and I am happy about any suggestion.
I have tried to adding this "repository" : { "type" : "git", "url" : "https://github.com/npm/npm.git" } to my package.json file.
But nothing went better.

@fetherston
Copy link
Owner

fetherston commented Feb 3, 2019

Warnings are generally okay. I wouldn't worry much about what's in your package.json except that after running npm install --save parrot-minidrone parrot-minidrone shows up under the dependencies key and you can see the library in your node modules folder (along with a pile of other stuff).

NOTE XPC-CONNECTION FAILS OT INSTALL ON THE LATEST NODE LTS
I've created a separate issue to track that: #28. Idk how to fix that just yet as it's a dependency of a dependency (noble).

I just walked through the steps and was able to use the package with node v8.12.0. and npm v6.4.1 on OSX Mojave.

  1. On a mac make sure you've installed xcode.
  2. Make sure you're on node 8.12.0 (node -v). If not, install and learn how to use nvm, it's easy.)
  3. Create a new folder for your node project and open it in terminal
  4. Create a new npm package npm init and hit enter through all the steps
  5. Install parrot-minidrone npm install --save parrot-minidrone
  6. It should install with warnings but not errors
  7. Create an index.js file with the contents from the readme.
  8. Run it node index.js

That's enough to at least get you running to write your own code. If you just want to fly some drones you may want to check out this entire repo from git and run the examples in the example folder.

@Rentex1
Copy link
Author

Rentex1 commented Feb 6, 2019

Thanks but now a new problem appeared:
npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! node-hid@0.5.7 install: prebuild-install || node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-hid@0.5.7 install script.

I have delete Node and npm and installed it again but nothin worked.
In the package.json file the the new version of node-hid is declared.
@0.7.6
I dont know what to do and it would be nice if you help me just that last time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants