- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试运行 react-native start
(和其他所有日子一样,它正常工作)它给了我这个错误:
错误
Loading dependency graph...events.js:287
throw er; // Unhandled 'error' event
^
Error: UNKNOWN: unknown error, lstat 'C:\Users\OKR\Desktop\MeetUp App\Development\MeetUp2\node_modules\jest-util\node_modules\.bin\mkdirp'
Emitted 'error' event on NodeWatcher instance at:
at NodeWatcher.checkedEmitError (C:\Users\OKR\Desktop\MeetUp App\Development\MeetUp2\node_modules\sane\src\node_watcher.js:143:12)
at Walker.emit (events.js:310:20)
at C:\Users\OKR\Desktop\MeetUp App\Development\MeetUp2\node_modules\walker\lib\walker.js:52:12
at FSReqCallback.oncomplete (fs.js:167:21) {
errno: -4094,
code: 'UNKNOWN',
syscall: 'lstat',
path: 'C:\\Users\\OKR\\Desktop\\MeetUp App\\Development\\MeetUp2\\node_modules\\jest-util\\node_modules\\.bin\\mkdirp'
}
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm@6.14.4
3 info using node@v12.16.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle MeetUp2@0.0.1~prestart: MeetUp2@0.0.1
6 info lifecycle MeetUp2@0.0.1~start: MeetUp2@0.0.1
7 verbose lifecycle MeetUp2@0.0.1~start: unsafe-perm in lifecycle true
8 verbose lifecycle MeetUp2@0.0.1~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\OKR\Desktop\MeetUp App\Development\MeetUp2\node_modules\.bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Git\cmd;c:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk\platform-tools;C:\Program Files\Java\jdk1.8.0_152\bin;C:\Program Files\nodejs\;C:\Users\OKR\AppData\Local\Microsoft\WindowsApps;C:\Users\OKR\AppData\Local\atom\bin;C:\Users\OKR\AppData\Local\Programs\Microsoft VS Code\bin;c:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk\platform-tools;C:\MinGW\bin;D:\Genymotion\tools;C:\Users\OKR\AppData\Roaming\npm
9 verbose lifecycle MeetUp2@0.0.1~start: CWD: C:\Users\OKR\Desktop\MeetUp App\Development\MeetUp2
10 silly lifecycle MeetUp2@0.0.1~start: Args: [ '/d /s /c', 'react-native start' ]
11 silly lifecycle MeetUp2@0.0.1~start: Returned: code: 1 signal: null
12 info lifecycle MeetUp2@0.0.1~start: Failed to exec start script
13 verbose stack Error: MeetUp2@0.0.1 start: `react-native start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:310:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:310:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid MeetUp2@0.0.1
15 verbose cwd C:\Users\OKR\Desktop\MeetUp App\Development\MeetUp2
16 verbose Windows_NT 10.0.17763
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "start"
18 verbose node v12.16.3
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error MeetUp2@0.0.1 start: `react-native start`
22 error Exit status 1
23 error Failed at the MeetUp2@0.0.1 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
node_modules
包和package-lock.json
并运行 npm install
.经过多次试验仍然失败node.js
到最新推荐版本:12.16.3
.然后重复以上步骤还是失败npm cache clean
(给出错误)并重复步骤 1 --> 失败 react-native start --reset-cache
它给出了同样的错误npm cache clean --force
它给了我错误:npm ERR! code UNKNOWN
npm ERR! syscall unlink
npm ERR! path C:\Users\OKR\AppData\Roaming\npm-cache\_cacache\content-v2\sha512\30\b7\d403a3bea9ab8b0dbca6fa631982d5c21917c8c72428787e88295705b25c8e0c47bf12524dc2bd05a21437c46e02e872ba6e4dca60f3d7c0754993757935
npm ERR! errno -4094
npm ERR! UNKNOWN: unknown error, unlink 'C:\Users\OKR\AppData\Roaming\npm-cache\_cacache\content-v2\sha512\30\b7\d403a3bea9ab8b0dbca6fa631982d5c21917c8c72428787e88295705b25c8e0c47bf12524dc2bd05a21437c46e02e872ba6e4dca60f3d7c0754993757935'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\OKR\AppData\Roaming\npm-cache\_logs\2020-05-26T13_16_06_204Z-debug.log
0 info it worked if it ends with ok 1 verbose cli [ 1 verbose cli 'C:\Program Files\nodejs\node.exe', 1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js', 1 verbose cli 'cache', 1 verbose cli 'clean', 1 verbose cli '--force' 1 verbose cli ] 2 info using npm@6.14.4 3 info using node@v12.16.3 4 warn using --force I sure hope you know what you are doing. 5 verbose npm-session ec09bc51399022bd 6 verbose stack Error: UNKNOWN: unknown error, unlink 'C:\Users\OKR\AppData\Roaming\npm-cache_cacache\content-v2\sha512\30\b7\d403a3bea9ab8b0dbca6fa631982d5c21917c8c72428787e88295705b25c8e0c47bf12524dc2bd05a21437c46e02e872ba6e4dca60f3d7c0754993757935' 7 verbose cwd C:\Users\OKR\Desktop\MeetUp App\Development\MeetUp2 8 verbose Windows_NT 10.0.17763 9 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "cache" "clean" "--force" 10 verbose node v12.16.3 11 verbose npm v6.14.4 12 error code UNKNOWN 13 error syscall unlink 14 error path C:\Users\OKR\AppData\Roaming\npm-cache_cacache\content-v2\sha512\30\b7\d403a3bea9ab8b0dbca6fa631982d5c21917c8c72428787e88295705b25c8e0c47bf12524dc2bd05a21437c46e02e872ba6e4dca60f3d7c0754993757935 15 error errno -4094 16 error UNKNOWN: unknown error, unlink 'C:\Users\OKR\AppData\Roaming\npm-cache_cacache\content-v2\sha512\30\b7\d403a3bea9ab8b0dbca6fa631982d5c21917c8c72428787e88295705b25c8e0c47bf12524dc2bd05a21437c46e02e872ba6e4dca60f3d7c0754993757935' 17 verbose exit [ -4094, true ]
cmd
在管理员模式下,但它会引发相同的错误 npm start
它给了我这个错误:Loading dependency graph...events.js:287
throw er; // Unhandled 'error' event
^
Error: UNKNOWN: unknown error, lstat 'C:\Users\OKR\Desktop\MeetUp_App\Development\MeetUp2\node_modules\jest-util\node_modules\.bin\mkdirp'
Emitted 'error' event on NodeWatcher instance at:
at NodeWatcher.checkedEmitError (C:\Users\OKR\Desktop\MeetUp_App\Development\MeetUp2\node_modules\sane\src\node_watcher.js:143:12)
at Walker.emit (events.js:310:20)
at C:\Users\OKR\Desktop\MeetUp_App\Development\MeetUp2\node_modules\walker\lib\walker.js:52:12
at FSReqCallback.oncomplete (fs.js:167:21) {
errno: -4094,
code: 'UNKNOWN',
syscall: 'lstat',
path: 'C:\\Users\\OKR\\Desktop\\MeetUp_App\\Development\\MeetUp2\\node_modules\\jest-util\\node_modules\\.bin\\mkdirp'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! MeetUp2@0.0.1 start: `react-native start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the MeetUp2@0.0.1 start 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\OKR\AppData\Roaming\npm-cache\_logs\2020-05-27T11_29_28_113Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm@6.14.5
3 info using node@v12.16.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle MeetUp2@0.0.1~prestart: MeetUp2@0.0.1
6 info lifecycle MeetUp2@0.0.1~start: MeetUp2@0.0.1
7 verbose lifecycle MeetUp2@0.0.1~start: unsafe-perm in lifecycle true
8 verbose lifecycle MeetUp2@0.0.1~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\OKR\Desktop\MeetUp_App\Development\MeetUp2\node_modules\.bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Git\cmd;c:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk\platform-tools;C:\Program Files\Java\jdk1.8.0_152\bin;C:\Program Files\nodejs\;C:\Users\OKR\AppData\Local\Microsoft\WindowsApps;C:\Users\OKR\AppData\Local\atom\bin;C:\Users\OKR\AppData\Local\Programs\Microsoft VS Code\bin;c:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk\platform-tools;C:\MinGW\bin;D:\Genymotion\tools;C:\Users\OKR\AppData\Roaming\npm
9 verbose lifecycle MeetUp2@0.0.1~start: CWD: C:\Users\OKR\Desktop\MeetUp_App\Development\MeetUp2
10 silly lifecycle MeetUp2@0.0.1~start: Args: [ '/d /s /c', 'react-native start' ]
11 silly lifecycle MeetUp2@0.0.1~start: Returned: code: 1 signal: null
12 info lifecycle MeetUp2@0.0.1~start: Failed to exec start script
13 verbose stack Error: MeetUp2@0.0.1 start: `react-native start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:310:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:310:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid MeetUp2@0.0.1
15 verbose cwd C:\Users\OKR\Desktop\MeetUp_App\Development\MeetUp2
16 verbose Windows_NT 10.0.17763
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.16.3
19 verbose npm v6.14.5
20 error code ELIFECYCLE
21 error errno 1
22 error MeetUp2@0.0.1 start: `react-native start`
22 error Exit status 1
23 error Failed at the MeetUp2@0.0.1 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
npx react-native upgrade
运行命令来升级 react-native .它给出了这个错误:info No version passed. Fetching latest...
info Fetching diff between v0.61.5 and v0.62.2...
info Applying diff...
warn Excluding files that exist in the template, but not in your project:
error Automatically applying diff failed. We did our best to automatically upgrade as many files as possible
warn Continuing after failure. Some of the files are upgraded but you will need to deal with conflicts manually
info Installing "react-native@0.62.2" and its peer dependencies...
error Command failed: npm install --save --save-exact react-native@0.62.2 react@16.11.0
npm ERR! Cannot read property 'match' of undefined
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\OKR\AppData\Roaming\npm-cache\_logs\2020-05-27T11_26_44_748Z-debug.log
. Run CLI with --verbose flag for more details.
Error: Command failed: npm install --save --save-exact react-native@0.62.2 react@16.11.0
npm ERR! Cannot read property 'match' of undefined
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\OKR\AppData\Roaming\npm-cache\_logs\2020-05-27T11_26_44_748Z-debug.log
at makeError (C:\Users\OKR\Desktop\MeetUp_App\Development\MeetUp2\node_modules\execa\index.js:174:9)
at C:\Users\OKR\Desktop\MeetUp_App\Development\MeetUp2\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async installDeps (C:\Users\OKR\Desktop\MeetUp_App\Development\MeetUp2\node_modules\react-native\node_modules\@react-native-community\cli\build\commands\upgrade\upgrade.js:206:3)
at async Object.upgrade [as func] (C:\Users\OKR\Desktop\MeetUp_App\Development\MeetUp2\node_modules\react-native\node_modules\@react-native-community\cli\build\commands\upgrade\upgrade.js:345:9)
at async Command.handleAction (C:\Users\OKR\Desktop\MeetUp_App\Development\MeetUp2\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:182:9)
{
"name": "MeetUp2",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"@eva-design/eva": "^1.4.0",
"@mapbox/polyline": "^1.1.0",
"@react-native-community/cameraroll": "^1.6.1",
"@react-native-community/datetimepicker": "^2.3.2",
"@react-native-community/google-signin": "^4.0.1",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-firebase/admob": "^6.7.1",
"@react-native-firebase/app": "^6.7.1",
"@react-native-firebase/auth": "^6.7.1",
"@react-native-firebase/firestore": "^6.7.1",
"@react-native-firebase/storage": "^6.7.1",
"@react-navigation/drawer": "^5.7.1",
"@react-navigation/native": "^5.2.6",
"@react-navigation/stack": "^5.3.1",
"@ui-kitten/components": "^4.4.1",
"axios": "^0.19.2",
"lodash": "^4.17.15",
"moment": "^2.25.3",
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-collapsingtoolbar": "^1.0.3",
"react-native-device-info": "^5.5.7",
"react-native-fbsdk": "^1.1.2",
"react-native-geolocation-service": "^4.0.1",
"react-native-gesture-handler": "^1.6.1",
"react-native-get-random-values": "^1.4.0",
"react-native-image-picker": "^2.3.1",
"react-native-keychain": "^6.0.0",
"react-native-maps": "^0.27.1",
"react-native-modal-datetime-picker": "^8.6.0",
"react-native-paper": "^3.10.1",
"react-native-reanimated": "^1.8.0",
"react-native-redash": "^14.0.4",
"react-native-safe-area-context": "^0.7.3",
"react-native-screens": "^2.7.0",
"react-native-share": "^3.3.2",
"react-native-svg": "^12.1.0",
"react-native-tab-view": "^2.14.0",
"react-native-vector-icons": "^6.6.0",
"react-native-view-shot": "^3.1.2",
"react-navigation-header-buttons": "^3.0.5",
"react-redux": "^7.2.0",
"redux": "^4.0.5",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0",
"rn-fetch-blob": "^0.12.0",
"uuid": "^8.0.0"
},
"devDependencies": {
"@babel/core": "^7.9.6",
"@babel/runtime": "^7.9.6",
"@react-native-community/eslint-config": "^0.0.7",
"babel-jest": "^25.5.1",
"eslint": "^6.8.0",
"jest": "^25.5.4",
"jetifier": "^1.6.5",
"metro-react-native-babel-preset": "^0.59.0",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
}
}
最佳答案
看起来问题出在 npm 缓存 .尝试以下解决方案:
运行命令:npm cache verify
如果出现错误,请运行:npm cache clear --force
右击 C: > 属性 > 工具选项卡 .
选择 查看或 立即查看在错误检查菜单下。
该过程完成后重新启动您的PC。
关于javascript - React Native 启动失败,错误代码 -4094 如何解决这个 ONCE for ALL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62015190/
我是一名优秀的程序员,十分优秀!