This is the weird question of the day – is there a way to install the Windows version of bs-platform (and node/npm) to a USB drive so I can take it with me anywhere? I don’t have admin access to the computers where I work.
Installing bs-platform to a USB drive
I would guess there are hardcoded paths in the binary that might be troublesome, but you should definitely try!
OK, this is ugly, but it seems to work:
- Download the .ZIP file of node and unzip it into directory
c:\users\yourname
(change the directory name tonode-v12
for ease of typing later on) set PATH=%PATH%;c:\users\yourname\node-v12
npm install bs-platform
set PATH=%PATH%;c:\users\yourname\node_modules\bs-platform\lib
bsb -init testing -theme basic-reason
cd testing
bsb -make-world
node src\Demo.bs.js
Everything should work fine. Now copy the node_modules
and node_v12
directories to the USB.
Go to another machine. Copy the directories back to c:\users\othername
and set the PATH
:
set PATH=%PATH%;c:\users\othername\node-v12;c:\users\othername\node_modules\bs-platform\lib
and that should work as well.
I don’t use a globally installed bs-platform
anymore, having a separate copy per project is a little bloated but now that we have precompiled OCaml binaries it installs so fast that I usually don’t notice.
Hi, this looks a valid use case (in particular for windows users), let me know (on github issues) if we can make your life easier on windows
This was a one-time thing I was experimenting with (was going to give a short class on ReasonML in a classroom filled with Windows machines to which I don’t have admin access).
Most of the time I’m using Linux.