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) {
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!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.