windows compatibility: monorepo does not symlink
See original GitHub issueFrom @1337cookie https://github.com/keystonejs/keystone-5/pull/1463#issuecomment-519957463
@MadeByMike and I saw the same issue. It is not seen when using admin
privillages but that is definitely not advised and not a solution.
C:\Users\user\Documents\web\keystone-5>bolt
⚡️ bolt v0.23.6 (node v10.16.1)
� [1/4] Validating project...
� [2/4] Installing project dependencies...
$ C:\Users\user\AppData\Local\Yarn\Data\global\node_modules\bolt\node_modules\.bin\yarn config get user-agent yarn/1.17.3 npm/? node/v10.16.1 win32 x64
yarn install v1.17.3
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.7: The platform "win32" is incompatible with this module.
info "fsevents@1.2.7" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.4: The platform "win32" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "apollo-server-express > apollo-server-core > apollo-tracing@0.5.2" has incorrect peer dependency "graphql@0.10.x - 14.1.x".
warning "graphql-playground-react > react-codemirror@1.0.0" has incorrect peer dependency "react@>=15.5 <16".
warning "graphql-playground-react > react-codemirror@1.0.0" has incorrect peer dependency "react-dom@>=15.5 <16".
[4/4] Building fresh packages...
$ yarn build:build-field-types && preconstruct dev && node ./packages/build-field-types/bin.js dev && yarn run --silent contributing-guide
yarn run v1.17.3
$ rimraf packages/build-field-types/lib && babel packages/build-field-types/src --out-dir packages/build-field-types/dist --ignore '**/__tests__/**/*','**/__mocks__/**/*'
Successfully compiled 42 files with Babel.
Done in 4.41s.
� info project is valid!
� error { [Error: EPERM: operation not permitted, symlink 'C:\Users\user\Documents\web\keystone-5\packages\arch\packages\alert\src\index.js' -> 'C:\Users\user\Documents\web\keystone-5\packages\arch\packages\alert\dist\alert.cjs.js.flow']
� error errno: -4048,
� error code: 'EPERM',
� error syscall: 'symlink',
� error path:
� error 'C:\\Users\\user\\Documents\\web\\keystone-5\\packages\\arch\\packages\\alert\\src\\index.js',
� error dest:
� error 'C:\\Users\\user\\Documents\\web\\keystone-5\\packages\\arch\\packages\\alert\\dist\\alert.cjs.js.flow' }
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error Error: spawn C:/Users/user/AppData/Local/Yarn/Data/global/node_modules/bolt/node_modules/.bin/yarn ENOENT
error at notFoundError (C:/Users/user/AppData/Local/Yarn/Data/global/node_modules/cross-spawn/lib/enoent.js:11:11)
error at verifyENOENT (C:/Users/user/AppData/Local/Yarn/Data/global/node_modules/cross-spawn/lib/enoent.js:46:16)
error at ChildProcess.cp.emit (C:/Users/user/AppData/Local/Yarn/Data/global/node_modules/cross-spawn/lib/enoent.js:33:19)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:18 (18 by maintainers)
Top Results From Across the Web
Git symbolic links in Windows - Stack Overflow
The benefit of using hardlinks+junctions over "true" NTFS symlinks is that elevated UAC permissions are not required in order for them to be...
Read more >Monorepos: Please don't - Hacker News
If breaking compatibility between components is the problem, one obvious solution is to no longer break compatibility.
Read more >Using yarn symlinks to share code between apps
This can be a great way to share code if: you're looking for a simple solution to share code.
Read more >Simplify your monorepo with npm 7 workspaces
The new "workspaces" property lets npm know that I want to track any packages inside ./common folder and automatically symlink them in the ......
Read more >.npmrc | pnpm
Your tooling doesn't work well with symlinks. ... This is a useful setting that can solve issues with long paths on Windows.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Seems like a windows/symlink limitation put in place as some sort of security measure. The short answer is Microsoft would like you to enable “developer mode” in windows if you want to create a symlink from a non-elevated command shell.
How to enable developer mode CLICK HERE TO SHOW
I personally didn’t require a restart or to sign out/sign in.
More related stuff @ ember.js docs including how to use “Local Security Policy” to change this setting, https://ember-cli.com/user-guide/#enabling-symlinks :
To create symlinks the account running Ember CLI must have the SeCreateSymbolicLinkPrivilege. Users in the Administrators group have this permission already. However, if UAC (User Access Control) is enabled, users in the Administrators group must run their shell using Run As Administrator because UAC strips away certain permissions from the Administrators +group, including SeCreateSymbolicLinkPrivilege.
Windows developer blog info https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10/:
For users who have Developer Mode enabled, the mklink command will now successfully create a symlink if the user is not running as an administrator.
Mystery solved?
That branch from the bolt PR did work for me in windows.
I spoke to one of the bolt maintainers in person today - They will need me to show why it works and determine whether it is the best change.
So I’ll working on that now.