所以我想安装一个依赖使用npm这是react-native-router-flux
,但由于它不工作,由于兼容性版本与反应& react-native,它是打破我的项目应用。所以我把它从package.json
文件中删除。文件未找到依赖性错误,而运行反应原生ios应用程序
企图以将其取出:
npm uninstall --save react-native-router-flux
甚至试图从的package.json文件中手动删除它,但由于某些原因,现在看起来我的整个项目是由于打破。 现在,每当我做npm start
这就是显示在我的终端:
error: bundling: Error: ENOENT: no such file or directory, open '/Users/marian-mac/Documents/dev/example/myapp/node_modules/react-native-router-flux/node_modules/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js'
at Error (native)
at Object.fs.openSync (fs.js:634:18)
at Object.fs.readFileSync (fs.js:502:33)
at Module._readSourceCode (/Users/marian-mac/Documents/dev/example/myapp/node_modules/react-native/packager/src/node-haste/Module.js:200:29)
at Module._getCacheProps (/Users/marian-mac/Documents/dev/example/myapp/node_modules/react-native/packager/src/node-haste/Module.js:420:29)
at Module._readFromTransformCache (/Users/marian-mac/Documents/dev/example/myapp/node_modules/react-native/packager/src/node-haste/Module.js:376:29)
at Module.readCached (/Users/marian-mac/Documents/dev/example/myapp/node_modules/react-native/packager/src/node-haste/Module.js:363:25)
at Promise.resolve.then (/Users/marian-mac/Documents/dev/example/myapp/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:167:29)
at process._tickCallback (internal/process/next_tick.js:103:7)
Bundling `index.ios.js` 94.0% (2941/3033)
我试图室射频/ node_modules 100倍和NPM安装另一个100倍,这样下去失败和失败,我无法理解哪里试图访问该文件!如果它被删除!
这是我的package.json现在:
{
"name": "myapp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"moment": "^2.18.1",
"native-base": "^2.1.3",
"react": "16.0.0-alpha.6",
"react-native": "0.44.0",
"react-native-flags": "^1.0.0"
},
"devDependencies": {
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.2",
"react-test-renderer": "16.0.0-alpha.6"
},
"jest": {
"preset": "react-native"
}
}
同样是投掷警告,版本和其他的一些东西:
npm WARN [email protected] requires a peer of [email protected]>=15.1.0 but none was installed.
npm WARN @shoutem/[email protected] requires a peer of [email protected]^15.0.0 but none was installed.
npm WARN [email protected] requires a peer of [email protected]^0.13.0 || ^0.14.0 || ^15.0.0 but none was installed.
这被抛出原生基依赖性:
UNMET PEER DEPENDENCY [email protected]^0.13.0 || ^0.14.0 || ^15.0.0
任何人都可以帮助我吗?这让我疯狂,几个小时一直在与这个“战斗”,而且我无法继续使用我的应用。
在此先感谢。
编辑:
后改变一些版本中为反应,反应天然和天然基。仍然有警告,看起来像打包程序正试图访问react-native-route-flux内的react-native文件。1)这是我的当前的package.json
{
"name": "myapp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"moment": "^2.18.1",
"native-base": "^2.1.3",
"react": "16.0.0-alpha.3",
"react-native": "^0.43.0",
"react-native-flags": "^1.0.0"
},
"devDependencies": {
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.2",
"react-test-renderer": "16.0.0-alpha.6"
},
"jest": {
"preset": "react-native"
}
}
2)这些是警告:
npm WARN [email protected] requires a peer of [email protected] but none was installed.
npm WARN [email protected] requires a peer of [email protected]>=15.1.0 but none was installed.
npm WARN @shoutem/[email protected] requires a peer of [email protected]^15.0.0 but none was installed.
npm WARN [email protected] requires a peer of [email protected]^0.13.0 || ^0.14.0 || ^15.0.0 but none was installed.
npm WARN [email protected] requires a peer of [email protected]^16.0.0-alpha.6 but none was installed.
也会引发一些未满足PEER DEPENDENCY上的本机基:
├─┬ [email protected]
│ ├─┬ @shoutem/[email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── UNMET PEER DEPENDENCY [email protected]^15.0.0
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── UNMET PEER DEPENDENCY [email protected]^0.13.0 || ^0.14.0 || ^15.0.0
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │ └── [email protected]
│ └── [email protected]
├─┬ UNMET PEER DEPENDENCY [email protected]
并在控制台运行时,从XCode中引发模拟器中的红色屏幕错误:
No Dimension set for key window
看起来它根据自己的GitHub的一个known issue。但该死的,我不想再使用react-native-router-flux了,我甚至没有在我的package.json中安装,也没有安装,并且仍然造成麻烦,这种依赖是病毒。
谢谢!我会在几个小时内尝试一下,我只需要多睡一会,直到凌晨三点才与之搏斗。再次感谢您花时间!我会保持你的更新。 – msqar
对它进行了测试,即使这些警告来自本机基地,它仍然不会给我反应 - native-router-flux这样的文件或目录,我仍然无法弄清楚为什么,如果它被卸载,甚至不是在我的项目中使用它,为什么它试图获取该文件? :S 在我安装了react-native-router-flux之前,我能够很好地处理包含native-base等的package.json。这就是为什么我知道依赖关系搞砸了我的整个项目。 – msqar
有两个选项可以删除本机基础或更改反应版本。 – Codesingh