Не получается запустить проект expo с помощью npm start
выдаёт такую ошибку:
[email protected] start /home/just/my-project
expo start
(node:3103) UnhandledPromiseRejectionWarning:
/home/just/my-project/node_modules/@expo/cli/build/src/api/rest/client.js:26
name = "ApiV2Error";
^
SyntaxError: Unexpected token =
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous (/home/just/my-project/node_modules/@expo/cli/build/src/api/getExpoGoIntermediateCertificate.js:7:15)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) (node:3103)
UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
error originated either by throwing inside of an async function
without a catch block, or by rejecting a promise which was not handled
with .catch(). (rejection id: 1) (node:3103) [DEP0018]
DeprecationWarning: Unhandled promise rejections are deprecated. In
the future, promise rejections that are not handled will terminate the
Node.js process with a non-zero exit code. (node:3103)
UnhandledPromiseRejectionWarning:
/home/just/my-project/node_modules/@expo/cli/build/src/api/rest/client.js:26
name = "ApiV2Error";
^
SyntaxError: Unexpected token =
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous (/home/just/my-project/node_modules/@expo/cli/build/src/api/getExpoGoIntermediateCertificate.js:7:15)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) (node:3103)
UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
error originated either by throwing inside of an async function
without a catch block, or by rejecting a promise which was not handled
with .catch(). (rejection id: 3)
Ответы (1 шт):
Эта ошибка указывает на проблему с синтаксисом в файле client.js, который находится в пакете @expo/cli.
Возможно, проблема связана с версией Node.js, которую вы используете. Попробуйте проверить, установлена ли на вашем компьютере последняя версия Node.js. Если у вас установлена старая версия, попробуйте обновить ее до последней версии.
Если обновление Node.js не помогло, попробуйте выполнить следующие шаги:
Удалите папку node_modules из своего проекта.
Очистите кэш NPM, запустив команду npm cache clean.
Установите зависимости заново, запустив команду npm install.
Попробуйте запустить проект снова, используя команду npm start.
Если эти шаги не решат проблему, попробуйте обновить пакет @expo/cli до последней версии, используя команду npm update @expo/cli.