gpt4 book ai didi

node.js - 软件包安装后 npm start 中断

转载 作者:太空宇宙 更新时间:2023-11-03 22:59:47 25 4
gpt4 key购买 nike

下面的原始问题

如果您现在使用create-react-native-app,该错误似乎已修复。现在使用react 0.55.2。

<小时/>

我们正在使用 React Native 构建一个项目。

当我从网站运行这些命令时:

create-react-native-app AwesomeProject

我运行npm start它工作得很好。

如果我更改我的包(我添加了这一行):

"react-native-form-builder": "^1.0.15",

我运行npm install,然后运行npm start,我收到此错误:

C:\everforms>npm start

> everforms@0.1.0 start C:\everforms
> react-native-scripts start

11:57:29: Starting packager...
***ERROR STARTING PACKAGER***
No issue with doctor-npm-version
No issue with doctor-watchman-version
No issue with doctor-problem-checking-watchman-version
No issue with doctor-both-app-and-exp-json
No issue with doctor-schema-validation
No issue with doctor-validate-asset-fields
No issue with doctor-schema-validation-exception
No issue with doctor-unversioned
No issue with doctor-versions-endpoint-failed
No issue with doctor-invalid-sdk-version
No issue with doctor-node-modules-missing
No issue with doctor-react-native-not-installed

C:\everforms\node_modules\react-native\local-cli\cliEntry.js:30
import type {CommandT} from './commands';
^^^^^^

SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Module._compile (C:\everforms\node_modules\pirates\lib\index.js:91:24)
at Module._extensions..js (module.js:663:10)
at Object.newLoader [as .js] (C:\everforms\node_modules\pirates\lib\index.js:96:7)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
11:57:35: Error starting packager: Error: Metro Bundler process exited with code 1
at ChildProcess.<anonymous> (C:\xdl@50.5.0\src\Project.js:1215:14)
at Generator.next (<anonymous>)
at step (C:\everforms\node_modules\xdl\build\Project.js:1768:191)
at C:\everforms\node_modules\xdl\build\Project.js:1768:437
at new Promise (<anonymous>)
at ChildProcess.<anonymous> (C:\everforms\node_modules\xdl\build\Project.js:1768:99)
at ChildProcess.packagerProcess.once (C:\xdl@50.5.0\src\Project.js:1213:5)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! everforms@0.1.0 start: `react-native-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the everforms@0.1.0 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\alber\AppData\Roaming\npm-cache\_logs\2018-07-05T09_57_35_135Z-debug.log

为什么会发生这种情况?

最佳答案

此错误是react-native 0.56中的一个新错误,影响Windows用户。要解决这个问题,您可以使用另一个react-native版本创建一个项目:

react-native init --version="0.55.4" MyNewApp

您可以在 this GitHub issue 中查看更多信息.

关于node.js - 软件包安装后 npm start 中断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51188515/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com