具体来说,我正在使用 meta-extractor
模块进行本地反应 .
'use strict';
//import React Native
import React, { Component } from 'react';
import {
Text,
StyleSheet,
View,
TextInput,
TouchableHighlight,
} from 'react-native';
var styles = require('../styles/styles');
var metagetplus = require('../../node_modules/meta-extractor');
这是错误消息:
无法从/Users/name/Desktop/instaldr/node_modules/meta-extractor/index.js解析模块URL:无法在其模块映射或/ Users / node_modules / url及其父级下的任何node_modules目录中找到此模块目录这可能与https://github.com/facebook/react-native/issues/4968有关
要解决此问题,请尝试以下操作:1 . 清除守望者 Watch : watchman watch-del-all
. 2.删除 node_modules
文件夹: rm -rf node_modules && npm install
. 3.重置打包缓存: rm -fr $TMPDIR/react-*
或 npm start -- --reset-cache
.
我尝试了该链接中提到的所有建议的解决方法,但似乎没有解决问题 . 有人可以帮我从这里出去吗?
1 回答
导入组件已更改,不应再使用require,请尝试:从('meta-extractor')导入metagetplus