我在创建react-360项目时遇到错误

问题描述 投票:0回答:2

当我使用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: [email protected]
npm ERR! Found: [email protected]
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 [email protected]
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

> [email protected] 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
2个回答
0
投票

好的,我刚刚运行了 npm install --force 并修复了所有问题!!


0
投票

错误修复: 预处理,我们需要使用rosetta和node 14.0.0来匹配X86_64和旧版本的node。

1.安装rosetta:https://apple.stackexchange.com/questions/428768/on-apple-m1-with-rosetta-how-to-open-entire-terminal-iterm-in-x86-64-architec

2.nvm安装14.0.0 nvm 使用 14.0.0

3.npm 安装(--force)

4.npm 启动然后

© www.soinside.com 2019 - 2024. All rights reserved.