小编Ned*_*rov的帖子

如何使用Expo清理(重置缓存)React Native.不确定是否是缓存问题

我正在使用creat-react-native-app构建一个简单的React Native应用程序,仅使用react-navigation和base-64(base 64编码/解码)作为依赖项.随着时间的推移,应用程序变得越来越慢,现在有时候在运行NPM启动后,"正在启动打包程序......"会卡住(等待大约30分钟).

我尝试用"npm start - --reset-cache"启动它,但没有任何改变

一旦启动并运行,我就不会在DevTools或终端中收到任何错误或警告.此外,应用程序的性能也没有问题

我能做些什么才能让NPM像以前一样平稳快速地开始?我可以采取任何一般步骤来解决此问题吗?

这是我的package.json

{
  "name": "test",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "jest-expo": "~27.0.0",
    "react-devtools": "^3.2.3",
    "react-native-scripts": "1.14.0",
    "react-test-renderer": "16.3.1"
  },
  "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
  "scripts": {
    "start": "react-native-scripts start",
    "eject": "react-native-scripts eject",
    "android": "react-native-scripts android",
    "ios": "react-native-scripts ios",
    "test": "jest"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "base-64": "^0.1.0",
    "expo": "^27.0.1",
    "react": "16.3.1",
    "react-native": "~0.55.2",
    "react-navigation": "^2.11.2"
  }
}
Run Code Online (Sandbox Code Playgroud)

react-native npm-start expo

26
推荐指数
5
解决办法
3万
查看次数

path.js:1086 错误:ENOENT:没有这样的文件或目录,uv_cwd

我正在遵循 Webpack 指南并在运行时卡在此处npm run build我收到此错误:

path.js:1086
          cwd = process.cwd();
                        ^

Error: ENOENT: no such file or directory, uv_cwd
    at Object.resolve (path.js:1086:25)
    at Function.Module._resolveLookupPaths (internal/modules/cjs/loader.js:479:17)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:587:20)
Run Code Online (Sandbox Code Playgroud)

我检查了所有进口,一切看起来都很好。比我认为的应该是缓存问题,所以我npm cache clean -f出人意料地跑了,我得到了完全相同的错误。可能是NodeJS问题,但我不知道如何调试它。

这是我的文件结构:

在此处输入图片说明

包.json

{
  "name": "test_webpack",
  "version": "1.0.0",
  "description": "",
  "private": true,
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "webpack"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "clean-webpack-plugin": "^1.0.0",
    "css-loader": "^1.0.1",
    "csv-loader": "^3.0.2",
    "file-loader": "^2.0.0",
    "html-webpack-plugin": …
Run Code Online (Sandbox Code Playgroud)

node.js npm webpack

13
推荐指数
4
解决办法
1万
查看次数

标签 统计

expo ×1

node.js ×1

npm ×1

npm-start ×1

react-native ×1

webpack ×1