安装'@ babel / preset-env'后出现错误

时间:2018-07-06 08:57:00

标签: react-native npm

当我尝试启动我的npm项目时,出现以下错误:

/home/projects/reactive-weather/reactive-weather/app/node_modules/expo/src/Location.js: 
Cannot find module '@babel/preset-env' from '/home/projects/reactive-weather/reactive-weather/app'

当然,我需要安装此模块,但这样做之后,我会收到此错误:

    Error: /home/projects/reactive-weather/reactive-weather/app/node_modules/expo/src/Location.js: Unexpected token, expected ";" (9:5)

   7 | const LocationEventEmitter = new NativeEventEmitter(NativeModules.ExponentLocation);
   8 |
>  9 | type ProviderStatus = {
     |      ^
  10 |   locationServicesEnabled: boolean,
  11 |   gpsAvailable: ?boolean,
  12 |   networkAvailable: ?boolean,
10:43:44 AM: Failed building JavaScript bundle

一切都很好,在此之前我做的最后一件事是使用git命令,例如:git stash我也必须执行npm审核修复,但我认为任何lib都不容易受到攻击。

0 个答案:

没有答案