Running `expo start` fails with ENOENT error just after installing expo-cli on windows 10 - react-native

I'm on Windows 10 Version 10.0.16299 Build 16299. I'm using Powershell. I just used yarn global add expo-cli to install expo, then I ran expo init my-app then cd my-app and expo start, but the build is failing. Here's the error image and text:
[23:11:49] Starting project at C:\projects\my-app
[23:11:58] Starting Metro Bundler on port 19001.
[23:11:58] Metro Bundler ready.
[23:12:00] Expo DevTools is running at http://localhost:19002
[23:12:00] Opening DevTools in the browser... (press shift-d to disable)
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:229:19)
at onErrorNT (internal/child_process.js:406:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Any ideas? Or even suggestions on another place where I can post this issue since it's failing out of the box. All help appreciated.

For windows:-
add environment variable in
set Path - C:\Windows\System32\
after setting path. restart your computer.

In my case, I added C:\Windows\System32\
See the Picture below:

Related

expo install react-native-svg "error Running this command will add the dependency to the workspace root rather than the workspace itself..."

I'm using Expo CLI. I want to use SVG in React Native. So, I follow an instruction from here https://github.com/react-native-svg/react-native-svg. But when I installed expo install react-native-svg I received the following error:
expo install react-native-svg
> yarn add react-native-svg
yarn add v1.22.11
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
error Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).
yarnpkg exited with non-zero code: 1
Error: yarnpkg exited with non-zero code: 1
at ChildProcess.completionListener (C:\Users\85620\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\spawn-async\src\spawnAsync.ts:65:13)
at Object.onceWrapper (events.js:482:26)
at ChildProcess.emit (events.js:375:28)
at ChildProcess.cp.emit (C:\Users\85620\AppData\Roaming\npm\node_modules\expo-cli\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (internal/child_process.js:1055:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
...
at Object.spawnAsync [as default] (C:\Users\85620\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\spawn-async\src\spawnAsync.ts:26:19)
at YarnPackageManager._runAsync (C:\Users\85620\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\package-manager\src\NodePackageManagers.ts:309:31)
at YarnPackageManager.addAsync (C:\Users\85620\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\package-manager\src\NodePackageManagers.ts:258:16)
at actionAsync (C:\Users\85620\AppData\Roaming\npm\node_modules\expo-cli\src\commands\installAsync.ts:55:12)
Screenshot1
And when I tried this command yarn add react-native-svg, I received this error
yarn add react-native-svg
error Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Screenshot2
Any suggestion? I'm new to Expo and React Native.
Maybe you should use expo command
expo install react-native-svg
According to this topic why does yarn warn when adding a dependency to the root workspaces package.json, now I can install it with the following command.
yarn workspace mobile-app add react-native-svg

Getting error when installing Bugsnag 'Error: spawn npm ENOENT'

this is the first time I post here so apologies if I don't follow some rules or incorrect formatting.
I'm making an app using React Native and Expo and when I try to install bugsnag I get this error.
$ npx bugsnag-expo-cli init
โˆš #bugsnag/expo does not appear to be installed, do you want to install it? ... yes
โˆš If you want the latest version of #bugsnag/expo hit enter, otherwise type the version you want ... latest
โˆš Using yarn or npm? ยป npm
> Installing #bugsnag/expo with npm. This could take a while!
Error: spawn npm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Are you attempting to run the bugsnag-expo-cli on Windows? The Expo CLI currently only supports MacOS and Linux:
https://docs.bugsnag.com/platforms/react-native/expo/#installation-and-configuration
As an alternative to the CLI, you can follow the manual integration guide:
https://docs.bugsnag.com/platforms/react-native/expo/manual-setup/

How to fix "Error: Watching remote files is not supported" problem in Visual Studio Code

I have Vue application that I don't run for a while and now I cannot start development server?! In meanwhile something updated and that don't work. I tried new clean vue/vuetify install and same problem!
Build for production works normally, only run development server don't work.
And important notice: when run "npm run serve" in command prompt (outside VS Code), it works normally. That not work only in VS Code Terminal. What is problem?
Node version is v10.16.0
Npm version is 6.10.3
VS Code About:
Commit: 036a6b1d3ac84e5ca96a17a44e63a87971f8fcc8
Date: 2019-08-08T02:33:50.993Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.17763
Error (from terminal window):
> Executing task: npm run serve <
> portal#0.1.0 serve d:\Wamp64\www\portal
> vue-cli-service serve
INFO Starting development server...
10% building 2/2 modules 0 active ERROR Error: Watching remote files is not supported.
Error: Watching remote files is not supported.
at Server.setupWatchStaticFeature (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:405:13)
at Object.watchContentBase (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:477:14)
at forEach (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:550:24)
at Array.forEach (<anonymous>)
at Server.setupFeatures (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:549:49)
at new Server (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:125:10)
at serve (d:\Wamp64\www\portal\node_modules\#vue\cli-service\lib\commands\serve.js:139:20)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! portal#0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the portal#0.1.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Sasa Gosovic\AppData\Roaming\npm-cache\_logs\2019-08-11T10_35_40_418Z-debug.log
The terminal process terminated with exit code: 1
Press any key to close the terminal.
Exactly the same issue here. I resolved it by rolling back the version of webpack-dev-server.
npm install webpack-dev-server#3.7.2 --save-dev
Looks like the setupWatchStaticFeature function has changed between 3.7.2 and 3.8.0 which is triggering the issue.
You can eddit the vue.config.js file, adding following code:
devServer: {
contentBase: './public'
}
More details: https://github.com/webpack/webpack-dev-server/issues/2190#issuecomment-520670599
Until the issue is open, a workaround could be to use Git Bash instead of Windows command line to run npm run serve. I modified Server.js to output the contentBase variable. When using Windows command line or Vue UI, the variable contained "c:\...". Using Git Bash on my Windows 10 machine it contains "C:\..." and it worked.

Appium - Android - Error: spawn appium ENOENT

I am trying to run android tests with the command node ./node_modules/.bin/wdio config/wdio.android.browser.conf.js and getting the following error:
me$ node ./node_modules/.bin/wdio config/wdio.android.browser.conf.js
events.js:183
throw er; // Unhandled 'error' event
^
Error: spawn appium ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:362:16)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickDomainCallback (internal/process/next_tick.js:219:9)
at Function.Module.runMain (module.js:696:11)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
I have the following versions in my package.json:
"wdio-appium-service": "^0.2.3",
"appium": "^1.12.1",
Please let me know what other info I can provide. Thank you.
I think I figured it out... in config/wdio.android.browser.conf.js I had services: [ 'appium' ], and trying to run just appium on my machine wasn't working. I installed appium globally with npm install -g appium and that made it work. I think I can point services to the appium in the local node_modules directory and maybe it would run it from there.
If you are using windows OS, appium section in your config file shall include command: 'appium.cmd' like this :
{
services: ['appium'],
appium: {
command: 'appium.cmd',
...
}
}
This error occurs due to 2 possible issues:
1) JAVAHOME variable is not correctly set for appium to start & run tests.
-> Check that JAVAHOME is correctly set and path points to the correct file.
2) There could have been some errors during Appium installation.
-> Try reinstalling appium using npm install -g appium command and ensure that appium is installed without any errors.
Obviously, run npm install to check and install any missing dependencies too.

React Native, Error while Launching Dev Tools. in ubuntu 16

I have installed a new react native project using create-react-native-app. When I do yarn start or npm start and scan with expo, it gives me the following error in ubuntu (when remote js debugging is on).
Launching Dev Tools...
Google Chrome exited with error: Error: Exited with code 1
at ChildProcess. (/home/shivam/AwesomeProject/node_modules/opn/index.js:86:8)
at Object.onceWrapper (events.js:254:19)
at ChildProcess.emit (events.js:159:13)
at maybeClose (internal/child_process.js:943:16)
at Socket.stream.socket.on (internal/child_process.js:363:11)
at Socket.emit (events.js:159:13)
at Pipe._handle.close [as _onclose] (net.js:568:12)
Finished building JavaScript bundle in 95196ms
Stopping packager...
Packager stopped.
Done in 701.25s.
But its not the case with windows(it opens the debugger in browser).I guess in ubuntu It tries to launch debugger in browser, but somehow fails to do so. I followed some links but none of them helped.
https://github.com/facebook/react-native/issues/9901
https://github.com/facebook/react-native/issues/990
https://github.com/facebook/react-native/issues/297
Run yarn or npm without sudo, because when you enable devtools it's tries opening chrome by command (chrome won't open with sudo)
You can do it open google chrome and hit this url http://localhost:8081/debugger-ui
open console tab to debug
Disable Chrome cache
Right-click chrome
Go to 'inspect element'
Look for the 'network' tab somewhere at the top. Click it.
Check the 'disable cache' checkbox.
Reference : react-native-debugging