【发布时间】:2021-06-14 16:57:28
【问题描述】:
当我使用 react-360 init myProject 启动新的 react-360 项目时出现此错误。它会创建文件夹,但当我 npm start 时会出现更多错误。
react-360 init MyProject
(node:17583) ExperimentalWarning: The fs.promises API is experimental
Creating new React 360 project...
Project directory created at MyProject
Copying assets...
Installing dependencies...
(node:17584) ExperimentalWarning: The fs.promises API is experimental
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: MyProject@0.0.1
npm ERR! Found: react@16.3.2
npm ERR! node_modules/react
npm ERR! react@"16.3.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"16.3.1" from react-native@0.55.4
npm ERR! node_modules/react-native
npm ERR! react-native@"~0.55.4" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/scylla/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/scylla/.npm/_logs/2021-03-17T10_50_46_670Z-debug.log
`npm` exited with code 1. Try fixing the errors above and run `npm` from within MyProject again.
当我运行 npm start 时
npm start
(node:17675) ExperimentalWarning: The fs.promises API is experimental
> MyProject@0.0.1 start
> node node_modules/react-360/scripts/packager.js
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module '/Users/scylla/Documents/cs/react360test/MyProject/node_modules/react-360/scripts/packager.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
关于如何解决它的任何想法?谢谢。
【问题讨论】:
标签: react-native npm react-360