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

Error: dirent.isSymbolicLink is not a function #2

Open
andrewmusselman opened this issue Jul 9, 2019 · 3 comments
Open

Error: dirent.isSymbolicLink is not a function #2

andrewmusselman opened this issue Jul 9, 2019 · 3 comments

Comments

@andrewmusselman
Copy link

I'm trying to run this, starting from a fresh template.

At first I had complaints about files already existing in www, but then I deleted everything in that directory.

I am still getting the error Error: dirent.isSymbolicLink is not a function; any idea how to resolve this?

@little-apps
Copy link

This error specifically is because you're using an older version of NodeJS. You need to update to at least NodeJS v10.10.0 for this problem to go away. However, after this you will most likely get another problem relating to the symbolic links:

EEXIST: file already exists, symlink 'xxxxx\build\index.html' -> 'xxxxx\www\index.html'

I was able to patch it by:

  1. Installing the fs-extra package:

$ npm i fs-extra

  1. Changing the fs require in assets\hooks\run-prod.js:
    const fs = require('fs') -> const fs = require('fs-extra')

  2. Modifying the createSymlink function in assets\hooks\run-prod.js to:

const createSymlink = () => {
fs.removeSync(wwwPath)
fs.copySync(buildPath, wwwPath)
}

There maybe a way to make the symlinks work but I find it's way easier to just copy the directory (especially for a production build).

@lukeforehand
Copy link

bumped into this today, searching for the fix was difficult, can you publish a fix so cordova create --template cordova-react works?

@NengakDakup
Copy link

I basically ran the command with admin privileges and it solved the issue for me.
For Ubuntu users, you can prefix your command with the "sudo" command, then for windows just basically run command prompt as an admin.

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

4 participants