Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected token error in fs-extra when building site #265

Closed
arnonzooz opened this issue Apr 28, 2020 · 8 comments
Closed

Unexpected token error in fs-extra when building site #265

arnonzooz opened this issue Apr 28, 2020 · 8 comments

Comments

@arnonzooz
Copy link

Hi

When deploying my site, I'm getting the following error:

Building sites … /builds/documentation/payudocs/node_modules/fs-extra/lib/mkdirs/make-dir.js:86
       } catch {
               ^
 SyntaxError: Unexpected token {
     at createScript (vm.js:80:10)

I'm not sure this is related to my pipeline, since I found this issue which seems to be the same:

vercel/pkg#883

Before I dive into this any further, does anyone know if this is related to the theme in any way? I do see that fs-extra is being referenced in /themes/docsy/assets/vendor/bootstrap/package-lock.json.

Thanks

@arnonzooz
Copy link
Author

OK, resolved this. If anyone else gets this error, just make to sure to upgrade to the latest node version. fs-extra": "^9.0.0 required node 10 or higher.

@lucasguiss
Copy link

OK, resolved this. If anyone else gets this error, just make to sure to upgrade to the latest node version. fs-extra": "^9.0.0 required node 10 or higher.

Thanks for the help, worked for me, i was using node 8

@Sathish3006
Copy link

OK, resolved this. If anyone else gets this error, just make to sure to upgrade to the latest node version. fs-extra": "^9.0.0 required node 10 or higher.

I'm also using node version 8 and also facing the same issue. Thank you for your answer bro. It works for me

@teerapon777
Copy link

C:\Users\TeeraponNeng\AppData\Roaming\npm\node_modules\cordova\node_modules\fs-extra\lib\mkdirs\make-dir.js:85
} catch {
^

SyntaxError: Unexpected token {
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (C:\Users\TeeraponNeng\AppData\Roaming\npm\node_modules\cordova\node_modules\fs-extra\lib\mkdirs\index.js:3:44)
[ERROR] Exception:

Help me !!!

@SurjithPoonu
Copy link

SurjithPoonu commented Aug 20, 2020

Same error here too, locally working fine , but in Bamboo..

@tattivitorino
Copy link

I'm trying to build an expo/react native project in release for android and no matter what i do i have the same error.
Do you have any idea what I could do?
thx

Expo CLI 4.1.0 environment info:
    System:
      OS: macOS 10.15.7
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 12.14.0 - ~/.nvm/versions/node/v12.14.0/bin/node
      Yarn: 1.13.0 - /usr/local/bin/yarn
      npm: 6.13.4 - ~/.nvm/versions/node/v12.14.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.8.4 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: iOS 14.1, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
      Android SDK:
        API Levels: 21, 22, 23, 24, 25, 26, 27, 28, 29
        Build Tools: 27.0.3, 28.0.3, 29.0.2
        System Images: android-22 | Google APIs Intel x86 Atom, android-25 | Google Play Intel x86 Atom, android-26 | Google Play Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom
        Android NDK: 20.1.5948944
    IDEs:
      Android Studio: 4.0 AI-193.6911.18.40.6514223
      Xcode: 12.1/12A7403 - /usr/bin/xcodebuild
    npmPackages:
      expo: ~39.0.2 => 39.0.4 
      react: 16.13.1 => 16.13.1 
      react-dom: 16.13.1 => 16.13.1 
      react-native: ~0.63.3 => 0.63.3 
      react-native-web: ~0.13.12 => 0.13.18 
      react-navigation: ^4.4.3 => 4.4.3 
    npmGlobalPackages:
      expo-cli: 4.1.0
    Expo Workflow: bare

@Hacane
Copy link

Hacane commented Feb 18, 2021

replace catch with catch (error)
just had the same problem and solved it by replacing catch with catch(error) so you need to add (error) next to each catch.
i needed to change this in about 10 files. so you gotta change every time and run it so you see the new location of the error. best of luck

@Hacane
Copy link

Hacane commented Feb 18, 2021

I had the same issue and solved it by replacing catch with catch (error)
notice that each time you correct this in the file shown in the error the same error will happen but with a different time. keep doing the same untill you change all catch (i had to do it around 10 times). once you have changed all of them it will work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants