0

Currently creating an android app. I am simply trying to import the spotify-web-api-node module.

One line so far in my index.android.js to do this:

import SpotifyWebApi from 'spotify-web-api-node';

When I go to load the JS into my emulator I get the follow error:

602/603Error while persisting cache: SyntaxError /path/to/the/project/node_modules/restler/lib/multipartform.js: Invalid number (112:35)

I am using a mac, this occurs for android (have not tried ios yet).

react-native -v = react-native-cli: 0.1.10 react-native: 0.21.0

Is this module surely not compatible with react-native or is there an edit I may need to make within restler to make it compatible? I see on the line it is complaining about, it is attempting to open/use the file system.

Line that is in the error description:

fs.open(this.value.path, "r", 0666, function (err, fd) {

1 Answer 1

1

First of all, I have never used this API. But after reading readme.md of spotify-web-api-node I found spotify-web-api-js

I assume you want to fire queries through spotify's API and display the results in your app. I'd suggest you to use spotify-web-api-js instead of spotify-web-api-node

You can call fetch() in your react-native app and use their API. Please let me know if this works. So that programmers who are facing the same problem will have an answer on this thread. Good luck!

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks! I will check this out and try it. Will report back and accept answer if it works for me. Seems like what I should use instead though.
@httpNick Sounds great!
Was able to successfully include and do a basic query. Thanks!
@httpNick Awesome!! Anytime.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.