Google-Spreadsheet - Could not resolve module 'path' - react-native

After installing google-spreadsheet and running my react-native project it throws below error:
error: Error: Unable to resolve module path from D:\Projects\MyProject\node_modules\google-auth-library\build\src\auth\googleauth.js: path could not be found within the project or in these directories:
node_modules
19 | const gcpMetadata = require("gcp-metadata");
20 | const os = require("os");
> 21 | const path = require("path");
| ^
22 | const crypto_1 = require("../crypto/crypto");
23 | const transporters_1 = require("../transporters");
24 | const computeclient_1 = require("./computeclient");
So I manually installed path npm i path --save
Afterward, this error is gone and the same issue for fs module came. So again I installed fs module then it gave me the below error:
error: Error: While trying to resolve module `fs` from file
`D:\Projects\MyProject\node_modules\google-auth-library\build\src\auth\googleauth.js`, the package `D:\Projects\MyProject\node_modules\fs\package.json`
was successfully found. However, this package itself specifies a `main` module field that could not be resolved

Related

How can i run next project in the my npm package?

I will think publish my npm package after solved the problem. My npm package have a next project in the package. But I installed package in random project for test. Everything work but web project not work. How can run web project in my npm package?
Error
`./src/app/page.jsx
Module parse failed: Unexpected token (40:4)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|
| const _searchArea = searchText == '' ? (null) : (
<div className='px-20 py-8'>
| Search Results
|
`
My next.config.js file
`/** #type {import('next').NextConfig} */
const nextConfig = {
experimental: {
appDir: true,
},
}
module.exports = nextConfig
`
and I installed npm packages in web project. But it'is not work.
problem

React-Native Cannot find Module '../../App'

When creating the SRC folder and inserting the appropriate items, react-native started giving this error:
AppEntry.js:1 Uncaught Error: Cannot find module '../../App'
Uncaught ReferenceError: process is not defined
index.js:1 ./node_modules/expo/AppEntry.js:3
Module not found: Can't resolve '../../App'
1 | import registerRootComponent from 'expo/build/launch/registerRootComponent';
2 |
> 3 | import App from '../../App';
4 |
5 | registerRootComponent(App);
From what I understand it is not finding the App with the path which is in "AppEntry.js".
However, AppEntry is by default in package.json:
"main": "node_modules/expo/AppEntry.js"
What should I do to fix?
You have moved your App.js or App.ts from root folder to 'src' so in appEntry you need to update your path from:
import App from '../../App';
To:
import App from '../../src/App';
Or you just can move back App.tsx to root folder
You can set the initializer path using the "main" property in package.json (note if you do so you need to write something like this.
import { registerRootComponent } from "expo";
import App from "./App";
export default registerRootComponent(App);
An example is https://github.com/trajano/spring-cloud-demo/blob/83887627274afa1970b5a0861e7c7d2e27efecce/expo-app/src/init/index.ts#L10-L13
with the package.json line https://github.com/trajano/spring-cloud-demo/blob/rework/expo-app/package.json#L5
Doing this gives you more flexibility, and I generally don't see the downside to doing it.

webpack issue with latest Expo (version 46) and React-Native-Elements

A clean-slate creation of an Expo-based React-Native app (npx create-expo-app my-app) and then installing react-native-elements runs fine on IOS, but generates the error below for running on the web. I also tried using the template provided by react-native-elements but wind-up with the same result.
Module parse failed: Unexpected token (7:58)
You may need an appropriate loader to handle this file type, currently no loaders are
configured to process this file. See https://webpack.js.org/concepts#loaders
| import { defaultSpacing } from './theme';
| import { lightColors } from './colors';
> const isClassComponent = (Component) =>
Boolean(Component?.prototype?.isReactComponent);
| const combineByStyles = (propName = '') => {
| if (propName.endsWith('Style') || propName.endsWith('style')) {
at ./node_modules/#rneui/themed/dist/config/withTheme.js```

AppLoading errors/issues for expo

SDK version: 44
My problem seems to be that I’m unable to install AppLoading on Expo.
Looking inside the package.json dependencies, I’m not able to find expo-app-loading
It says I have to install it manually by typing: expo install expo-app-loading in the terminal. I've tried doing so but nothing changes and I still can't see expo-app-loading installed in package.json dependencies.
As soon as I import AppLoading from 'expo-app-loading'; I get bombarded by errors that I've copy/pasted below:
Any help on how to solve this issue would be greatly appreciated!
1 | import React from ‘react’;
2 |
3 | import { AppLoadingProps } from ‘./AppLoading.types’;
4 | import NativeAppLoading from ‘./AppLoadingNativeWrapper’;
…/…/…/…/…/node_modules/expo-app-loading/build/AppLoadingNativeWrapper.js:2
Module not found: Can’t resolve ‘react’
1 | import * as SplashScreen from ‘expo-splash-screen’;
2 | import React from ‘react’;
3 |
4 | type Props = {
5 | autoHideSplash?: boolean;
…/…/…/…/…/node_modules/expo-modules-core/build/PermissionsHook.js:1
Module not found: Can’t resolve ‘react’
1 | import { useCallback, useEffect, useRef, useState } from ‘react’;
2 |
3 | import { PermissionResponse } from ‘./PermissionsInterface’;
4 |
C:/Users/Admin/node_modules/expo-modules-core/build/index.js
Module not found: Error: Can’t resolve ‘react-native-web/dist/exports/DeviceEventEmitter’ in ‘C:\Users\Admin\node_modules\expo-modules-core\build’
C:/Users/Admin/node_modules/expo-modules-core/build/EventEmitter.js
Module not found: Error: Can’t resolve ‘react-native-web/dist/exports/NativeEventEmitter’ in ‘C:\Users\Admin\node_modules\expo-modules-core\build’
C:/Users/Admin/node_modules/expo-modules-core/build/Platform.js
Module not found: Error: Can’t resolve ‘react-native-web/dist/exports/Platform’ in ‘C:\Users\Admin\node_modules\expo-modules-core\build’
C:/Users/Admin/node_modules/expo-modules-core/build/EventEmitter.js
Module not found: Error: Can’t resolve ‘react-native-web/dist/exports/Platform’ in ‘C:\Users\Admin\node_modules\expo-modules-core\build’
…/…/…/…/…/node_modules/expo-modules-core/build/SyntheticPlatformEmitter.web.js:5
Module not found: Can’t resolve ‘react-native-web/dist/vendor/react-native/NativeEventEmitter/RCTDeviceEventEmitter’
3 | * registered in the API layer with NativeEventEmitter.
4 | */
5 | export { default } from ‘react-native-web/dist/vendor/react-native/NativeEventEmitter/RCTDeviceEventEmitter’;
6 |
Error from chokidar (C:): Error: EBUSY: resource busy or locked, lstat ‘C:\DumpStack.log.tmp’```

ERROR in ./node_modules/file-base64/index.js Module not found: Error: Can't resolve 'fs'

I'm using vue js and laravel mix.
I dl the file-base64 npm package.
And when i compile, i get this error =>
ERROR in ./node_modules/file-base64/index.js Module not found: Error: Can't resolve 'fs'
in the file-base-64 it import var fs = require('fs');
But i have access the fs.d.ts file. It feels the when it compile, it don't have a direct access.
Do someone got the same issue?