Skip to content

Symlink Error: EPERM: operation not permitted on Windows #381

Closed

Description

@roshan-sama

Upon forking and cloning the blitzjs repository (https://github.com/blitz-js/blitz), running the preconstruct dev command causes the following error

PS C:\Users\Roshan\Documents\DeleteMe\blitz> yarn dev
yarn run v1.22.10
$ preconstruct dev && concurrently --names "typecheck,cli,templates" -c "blue,green,yellow,magenta" -p "{name}" "npm:dev:tsc" "npm:dev:cli" "npm:dev:templates"
��� info project is vali
��� error [Error: EPERM: operation not permitted, symlink 'C:\Users\Roshan\Documents\Delet
e\blitz\packages\config\src\index.ts' -> 'C:\Users\Roshan\Documents\DeleteMe\blitz\packages\config\dist\blitzjs-config.esm.js'] {
��� error   errno: -4048,
��� error   code: 'EPERM',
��� error   syscall: 'symlink',
��� error   path: 'C:\\Users\\Roshan\\Documents\\DeleteMe\\blitz\\packages\\config\\src\\i
ex.ts',
��� error   dest: 'C:\\Users\\Roshan\\Documents\\DeleteMe\\blitz\\packages\\config\\dist\\
itzjs-config.esm.js'
��� error }
��� info If want to learn more about the above error, check https://preconstruct.tools/err
s
��� info If the error is not there and you want to learn more about it, open an issue at h
ps://github.com/preconstruct/preconstruct/issues/new
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 

package.json for this project has

...
{
  "name": "root",
...
  "preconstruct": {
    "packages": [
      "packages/*",
      "!packages/cli",
      "!packages/eslint-config"
    ]
  },
...
"dependencies": {
...
    "@preconstruct/cli": "2.0.5",
    "@preconstruct/next": "2.0.0",
...
}

Is there a way to avoid this EPERM issue? We're tracking this in the blitzjs repository in issue blitz-js/legacy-framework#195, and I am currently working around this by running preconstruct watch in one terminal, and the other commands in a separate terminal.

Activity

  1. emmatown commented on Mar 8, 2021

    @emmatown
    Member

    You need to enable Windows Developer Mode so that Preconstruct can create symlinks - https://www.howtogeek.com/292914/what-is-developer-mode-in-windows-10/

  2. roshan-sama commented on Mar 9, 2021

    @roshan-sama
    Author

    Ah, I did not know this was a thing, enabling Developer mode fixed it. Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions