I just tried adding some node modules into react-native.
I figure out it will work only with react-native modules and react-native link
that modules.
I want to use: - https://www.npmjs.com/package/node-google-image-search or - https://www.npmjs.com/package/first-image-search-load
I tried: Link1 Link2 Link3 Link4
When I'm using command link with "non-react modules" I still get nothing:
Also, when I just trying to add this module by:
import 'first-image-search-load'
import {saveFirstImage} from 'first-image-search-load'
import * from 'first-image-search-load'
var first-image-search-load = require('first-image-search-load');
var first-image-search-load = require('./first-image-search-load');
var first-image-search-load = require('./node-modules/first-image-search-load');
and trying put these in index.android.js I get:
The development server returned response error code: 500
URL: http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false
Body: {"message":"Unable to resolve module https from /Users/Pien/Projects/smog_bielsko/node_modules/node-google-image-search/index.js: Module does not exist in the module map or in these directories:\n /Users/Pien/Projects/smog_bielsko/node_modules/node-google-image-search/node_modules\n, /Users/Pien/Projects/smog_bielsko/node_modules\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n 1. Clear watchman watches:
watchman watch-del-all
.\n 2. Delete thenode_modules
folder:rm -rf node_modules && npm install
.\n 3. Reset packager cache:rm -fr $TMPDIR/react-*
ornpm start -- --reset-cache
.","name":"UnableToResolveError","type":"UnableToResolveError","errors":[{}]} onResponse DevServerHelper.java:323 execute RealCall.java:126 run NamedRunnable.java:32 runWorker ThreadPoolExecutor.java:1113 run ThreadPoolExecutor.java:588 run Thread.java:818
Please tell me how I can import normal npm plugins into react-native..
Thx