# 执行npm install --save react-navigation后，项目无法运行。

**URL:** <https://www.shiqidu.com/t/topic/190>\
**Category:** 开发调优\
**Tags:** React-Native\
**Created:** [2017 年6 月 28 日 05:10 UTC](https://www.shiqidu.com/t/topic/190 "2017-06-28T05:10:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

作者： ![Leon](https://www.shiqidu.com/user_avatar/www.shiqidu.com/leon/32/5_2.png) [@Leon](https://www.shiqidu.com/u/Leon)\
发布日期： [2017 年6 月 28 日 05:10 UTC](https://www.shiqidu.com/t/topic/190/1 "2017-06-28T05:10:56Z")

</div>

报错信息如下

![](https://discourse.shiqidu.com/uploads_nj/article/2017-06-28/59533a3698ddc.png)

```bash
error: bundling: UnableToResolveError: Unable to resolve module `react` from `/Users/luzhuang/develop/shiqidu/index.ios.js`: Module does not exist in the module map or in these directories:
  /Users/luzhuang/develop/shiqidu/node_modules

This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
  1. Clear watchman watches: `watchman watch-del-all`.
  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
  3. Reset packager cache: `rm -fr $TMPDIR/react-*` or `npm start -- --reset-cache`.
    at ResolutionRequest._resolveNodeDependency (/Users/luzhuang/develop/shiqidu/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:394:11)
    at tryResolveSync (/Users/luzhuang/develop/shiqidu/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:136:20)
    at tryResolveSync (/Users/luzhuang/develop/shiqidu/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:66:12)
    at ResolutionRequest.resolveDependency (/Users/luzhuang/develop/shiqidu/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:134:22)
    at dependencyNames.map.name (/Users/luzhuang/develop/shiqidu/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:145:59)
    at Array.map (native)
    at ResolutionRequest.resolveModuleDependencies (/Users/luzhuang/develop/shiqidu/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:145:42)
    at Promise.resolve.then (/Users/luzhuang/develop/shiqidu/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:169:21)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:169:7)

```

**原因**

可能是npm5有bug

**解决方法**

使用`yarn`代替`npm install`

`yard add`代替`npm install --save`

```bash
yarn add react-navigation

```
