Vscode-react-native: React Native is not installed. Please run `npm install` in your project directory.

Created on 11 Dec 2018  ยท  10Comments  ยท  Source: microsoft/vscode-react-native

Actual Behavior

Trying to launch a sample app on React Native with Debug in Expo results in this strange error, from the react-native output:

[Error] Error: React Native is not installed. Please run `npm install` in your project directory.
[Error] Error: Couldn't start project. Please fix the errors and restart the project.
Loading dependency graph, done.

Obviously react-native as well as react-native-cli are installed everywhere (globally and locally) :)
Running my expo application from expo, using expo start --android works correctly.
But trying from within VS Code, using vscode-react-native plugins seems broken.

I've tried several things, including installing react-native-cli using both npm and yarn, I've always the same behavior

Running react-native -v in my terminal, from my project root folder, works as expected:

$ react-native -v
react-native-cli: 2.0.1
react-native: 0.57.7

In the other hand, I've successfully launched the application without expo, but using only Debug in Android, without any issue. Launching the app is working, and debugger is working as well as expected

Software versions

  • React-Native VS Code extension version: 0.7.0
  • VSCode version: 1.29.1
  • OS platform and version: Windows 10
  • NodeJS version: 11.4
  • React Native version: 0.57.7
  • Expo SDK version (include if relevant): 2.6.9

Outputs (Include if relevant)

  • Output of the React-Native output channel (View -> Toggle Output -> Select React-Native in ListBox):
Checking if this is Expo app......
[Info] Starting Packager

[Debug] Executing command: react-native.cmd start --port 8081

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                                                                              โ”‚
โ”‚  Running Metro Bundler on port 8081.                                         โ”‚
โ”‚                                                                              โ”‚
โ”‚  Keep Metro running while developing on any JS projects. Feel free to        โ”‚
โ”‚  close this tab and run your own Metro instance if you prefer.               โ”‚
โ”‚                                                                              โ”‚
โ”‚  https://github.com/facebook/react-native                                    โ”‚
โ”‚                                                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Looking for JS files in
   c:\PROJECTS\REACT\broproject 

[Info] Packager started.

[Info] Prewarming bundle cache. This may take a while ...

[Info] Building and running application.

No issue with doctor-watchman-versionNo issue with doctor-watchman-versionNo issue with doctor-watchman-versionNo issue with doctor-watchman-versionNo issue with doctor-watchman-versionNo issue with doctor-problem-checking-watchman-versionNo issue with doctor-problem-checking-watchman-versionNo issue with doctor-problem-checking-watchman-versionNo issue with doctor-problem-checking-watchman-versionNo issue with doctor-problem-checking-watchman-versionNo issue with doctor-both-app-and-exp-jsonNo issue with doctor-both-app-and-exp-jsonNo issue with doctor-both-app-and-exp-jsonNo issue with doctor-both-app-and-exp-jsonNo issue with doctor-both-app-and-exp-jsonNo issue with doctor-schema-validationNo issue with doctor-schema-validationNo issue with doctor-schema-validationNo issue with doctor-schema-validationNo issue with doctor-schema-validationNo issue with doctor-validate-asset-fieldsNo issue with doctor-validate-asset-fieldsNo issue with doctor-validate-asset-fieldsNo issue with doctor-validate-asset-fieldsNo issue with doctor-validate-asset-fieldsNo issue with doctor-schema-validation-exceptionNo issue with doctor-schema-validation-exceptionNo issue with doctor-schema-validation-exceptionNo issue with doctor-schema-validation-exceptionNo issue with doctor-schema-validation-exceptionNo issue with doctor-unversionedNo issue with doctor-unversionedNo issue with doctor-unversionedNo issue with doctor-unversionedNo issue with doctor-unversionedNo issue with doctor-versions-endpoint-failedNo issue with doctor-versions-endpoint-failedNo issue with doctor-versions-endpoint-failedNo issue with doctor-versions-endpoint-failedNo issue with doctor-versions-endpoint-failedNo issue with doctor-invalid-sdk-versionNo issue with doctor-invalid-sdk-versionNo issue with doctor-invalid-sdk-versionNo issue with doctor-invalid-sdk-versionNo issue with doctor-invalid-sdk-versionNo issue with doctor-node-modules-missingNo issue with doctor-node-modules-missingNo issue with doctor-node-modules-missingNo issue with doctor-node-modules-missingNo issue with doctor-node-modules-missing[Error] Error: React Native is not installed. Please run `npm install` in your project directory.

[Error] Error: React Native is not installed. Please run `npm install` in your project directory.

[Error] Error: React Native is not installed. Please run `npm install` in your project directory.

[Error] Error: React Native is not installed. Please run `npm install` in your project directory.

[Error] Error: React Native is not installed. Please run `npm install` in your project directory.

[Error] Error: Couldn't start project. Please fix the errors and restart the project.

Loading dependency graph, done.
debugger expo external resolved

Most helpful comment

From my last attempt :)

  "dependencies": {
    "expo": "^31.0.2",
    "react": "^16.6.3",
    "react-native": "^0.57.7"
  },
  "devDependencies": {
    "babel-preset-expo": "^5.0.0"
  },

All 10 comments

Hi @Mimetis and thanks for reaching us. I am facing this as well since yesterday and currently digging into it. I'll keep you posted.

@Mimetis btw what Expo SDK version is used in your project?

I've just installed everything today, so I guess the last one :)

$ expo --version
2.6.9

@Mimetis I mean not the expo cli version, but expo sdk version. Could you please copy-paste dependencies section of package.json?

From my last attempt :)

  "dependencies": {
    "expo": "^31.0.2",
    "react": "^16.6.3",
    "react-native": "^0.57.7"
  },
  "devDependencies": {
    "babel-preset-expo": "^5.0.0"
  },

@Mimetis thanks for the info. ๐Ÿ‘ I'll let you know about any news from my side.

Just tried with node version 10.14.1 and 9.11.2.
It's still not working.
I'm continuing my investigations on my side

Hi @Mimetis, issue was caused by bug in xdl package, latest version of which we dynamically install and then cache inside installed extension directory only when expo debug scenarios are being engaged. So, all folks who tried to use expo debugging in the extension for the first time two days ago (when the corrupted version 52.0.8 of xdl was released) are affected. Since 52.0.9 this problem is fixed.

To fix the issue you need to uninstall extension, restart VS Code (not just clicking on "reload" button on extension page) and install it again.

After that debugging should work as usual.

@Mimetis please let me know whether it helps you or not.

Thx @ruslan-bikkinin !!
Uninstalling both extension and expo-cli did the trick !
With a new clean install, everything is now eventually working :)

Thx for all !

Was this page helpful?
0 / 5 - 0 ratings