For fun I thought I'd try building Calypso under Bash on Ubuntu on Windows. For those that are unaware, these are the exact same user-mode binaries from Ubuntu just running in Windows. It's not a VM or anything. Super cool. :)
viper007bond@VIPER007BOND:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
That means that everything works* magically and I can check out a copy of Calypso directly to my "mounted" Windows filesystem:
viper007bond@VIPER007BOND:/mnt/c/Work$ git clone https://github.com/Automattic/wp-calypso.git
Cloning into 'wp-calypso'...
remote: Counting objects: 107626, done.
remote: Compressing objects: 100% (246/246), done.
remote: Total 107626 (delta 127), reused 6 (delta 6), pack-reused 107368
Receiving objects: 100% (107626/107626), 28.79 MiB | 5.88 MiB/s, done.
Resolving deltas: 100% (72384/72384), done.
Checking connectivity... done.
Checking out files: 100% (4082/4082), done.
viper007bond@VIPER007BOND:/mnt/c/Work$ cd wp-calypso
viper007bond@VIPER007BOND:/mnt/c/Work/wp-calypso$ make run
_
___ __ _| |_ _ _ __ ___ ___
/ __/ _` | | | | | '_ \/ __|/ _ \
| (_| (_| | | |_| | |_) \__ \ (_) |
\___\__,_|_|\__, | .__/|___/\___/
|___/|_|
Unfortunately it seems the file watcher doesn't want to play nice:
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
Hash: 4f7fd3ab7e2d10f4b1cf
Version: webpack 1.13.1
Time: 10881ms
Asset Size Chunks Chunk Names
bundle-development.js 2.27 MB 0 [emitted] main
bundle-development.js.map 2.92 MB 0 [emitted] main
+ 995 hidden modules
Rendering Complete, saving .css file...
Wrote CSS to /mnt/c/Work/wp-calypso/public/style.css
Saving: /mnt/c/Work/wp-calypso/public/style-rtl.css
Rendering Complete, saving .css file...
Wrote CSS to /mnt/c/Work/wp-calypso/public/style-debug.css
Wrote Source Map to /mnt/c/Work/wp-calypso/public/style-debug.css.map
Rendering Complete, saving .css file...
Wrote CSS to /mnt/c/Work/wp-calypso/public/editor.css
wp-calypso booted in 1185ms - http://calypso.localhost:3000
Getting bundles ready, hold on...
Error: watch assets/stylesheets EPERM
at exports._errnoException (util.js:1036:11)
at FSWatcher.start (fs.js:1429:19)
at Object.fs.watch (fs.js:1456:11)
at createFsWatchInstance (/mnt/c/Work/wp-calypso/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/mnt/c/Work/wp-calypso/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/mnt/c/Work/wp-calypso/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleDir (/mnt/c/Work/wp-calypso/node_modules/chokidar/lib/nodefs-handler.js:407:19)
at FSWatcher.<anonymous> (/mnt/c/Work/wp-calypso/node_modules/chokidar/lib/nodefs-handler.js:455:19)
at FSWatcher.<anonymous> (/mnt/c/Work/wp-calypso/node_modules/chokidar/lib/nodefs-handler.js:460:16)
at FSReqWrap.oncomplete (fs.js:123:15)
make: *** [run] Error 1
I also tried it just within /home/viper007bond/ which is mapped to a directory buried in my Windows user directory but that doesn't work either.
Anyone have any ideas here?
I'm having the exact same issue. It is an issue with Bash on Windows. You can read about it here: https://github.com/Microsoft/BashOnWindows/issues/216
Unfortunately, it looks like we will have to wait on a Windows update for this to be resolved. There doesn't appear to be a workaround.
Hello, curious passerby here, but file watchers should now work in the latest insider preview build. https://blogs.msdn.microsoft.com/commandline/2016/10/07/wsl-adds-inotify-filesystem-change-notification-support/ Also @Viper007Bond doesn't
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
Hash: 4f7fd3ab7e2d10f4b1cf
Version: webpack 1.13.1
Time: 10881ms
doom the entire build since fsevents is for macOS only? I was hoping to run wp-calypso on my local windows 10 machine but now that I see that error it doesn't seem like it would work.
Hopefully fsevents works with the latest Insider Preview build, but if it doesn't then yeah, I think we would need some type of rebuild command that would trigger it manually after changing a file, which would suck but at least it'd work. Not my area of expertise though, just one of the very rare Windows users at @Automattic who previously played with Calypso via Vagrant.
This issue has been marked as stale because it hasn't been updated in a while. It will be closed in a week.
If you would like it to remain open, can you please you comment below and see what you can do to get things moving with this issue?
Thanks! 馃檹
Works great now. 馃憤
hello @Viper007Bond
do you add modification ?
fsevents still doesn't work because it's for OS X only, not Linux or Windows. However unlike when I opened this ticket, the lack of fsevents no longer breaks the build process and I can successfully run Calypso under WSL.
It's also worth mentioning that I'm running Node 8.9.3 and npm 5.5.1 as described in package.json thanks to https://github.com/creationix/nvm.
Most helpful comment
I'm having the exact same issue. It is an issue with Bash on Windows. You can read about it here: https://github.com/Microsoft/BashOnWindows/issues/216
Unfortunately, it looks like we will have to wait on a Windows update for this to be resolved. There doesn't appear to be a workaround.