keystone: windows compatibility: monorepo does not symlink
From @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)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 18 (18 by maintainers)
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.
I do want this to work on Windows. for now I used WSL (Windows Subsystem for Linux) for Windows 10 so that I can get through any issue.