Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

error: _os.platform is not a function after expo start

$
0
0

this error has been bugging me for days, hope someone can help me here

TypeError: _os.platform is not a function. (In '_os.platform()', '_os.platform' is undefined)at node_modules\react-native\Libraries\LogBox\LogBox.js:148:8 in registerErrorat node_modules\react-native\Libraries\LogBox\LogBox.js:59:8 in errorImplat node_modules\react-native\Libraries\LogBox\LogBox.js:33:4 in console.errorat node_modules\expo\build\environment\react-native-logs.fx.js:27:4 in errorat node_modules\react-native\Libraries\Core\ExceptionsManager.js:104:6 in reportExceptionat node_modules\react-native\Libraries\Core\ExceptionsManager.js:171:19 in handleExceptionat node_modules\react-native\Libraries\Core\setUpErrorHandling.js:24:6 in handleErrorat node_modules\expo-error-recovery\build\ErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0at node_modules\regenerator-runtime\runtime.js:45:36 in tryCatchat node_modules\regenerator-runtime\runtime.js:274:29 in invokeat node_modules\regenerator-runtime\runtime.js:45:36 in tryCatchat node_modules\regenerator-runtime\runtime.js:135:27 in invokeat node_modules\regenerator-runtime\runtime.js:145:18 in PromiseImpl.resolve.then$argument_0at node_modules\react-native\node_modules\promise\setimmediate\core.js:37:13 in tryCallOneat node_modules\react-native\Libraries\Core\Timers\JSTimers.js:130:14 in _callTimerat node_modules\react-native\Libraries\Core\Timers\JSTimers.js:181:14 in _callImmediatesPassat node_modules\react-native\Libraries\Core\Timers\JSTimers.js:441:30 in callImmediatesat node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:387:6 in __callImmediatesat node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:135:6 in __guard$argument_0at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guardat node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:134:4 in flushedQueue

i got this error right after expo start, it happened right after i set some wsl configurations and installed Docker. Thus, i went to find out the codes caused this error, it was from getNodeSystem() in typescript.js which inside node_modules

var isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";var platform = _os.platform();var useCaseSensitiveFileNames = isFileSystemCaseSensitive();

so i tried to console.log _os value, i found out values are empty objects

function getNodeSystem() {            var nativePattern = /^native |^\([^)]+\)$|^(internal[\\/]|[a-zA-Z0-9_\s]+(\.js)?$)/;            var _fs = require("fs");            var _path = require("path");            var _os = require("os");            console.log(process.env)            console.log(_fs)            console.log(_path)            console.log(_os)

return value:

Object {"NODE_ENV": "development",}Object {}Object {}Object {}

Hope someone can help me


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>