Coder Social home page Coder Social logo

ocaml-reason-wsl's People

Contributors

fhelwanger avatar superherointj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ocaml-reason-wsl's Issues

Install failed

My OS is Windows 10 Pro, Version 1703, OS build 15063.540

I have installed Windows Subsystem for Linux and NPM

I tried to install this repo, but installation failed with following error.

npm install -g ocaml-on-windows

[email protected] preinstall C:\Program Files\nodejs\node_modules\ocaml-on-windows
bin\preinstall.bat

"Installing ocaml..."
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
"Configuring opam..."
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
"Installing reason..."
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] preinstall: bin\preinstall.bat
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Vinay\AppData\Roaming\npm-cache_logs\2017-08-09T11_53_09_966Z-debug.log

The log file is as follows:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'ocaml-on-windows' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session c78648abed7ef7fb
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/ocaml-on-windows 638ms
8 silly pacote tag manifest for ocaml-on-windows@latest fetched in 901ms
9 silly install loadIdealTree
10 silly install cloneCurrentTreeToIdealTree
11 silly install loadShrinkwrap
12 silly install loadAllDepsIntoIdealTree
13 silly resolveWithNewModule [email protected] checking installable status
14 silly currentTree nodejs
15 silly idealTree nodejs
15 silly idealTree -- [email protected] 16 silly install generateActionsToTake 17 silly diffTrees action count 1 18 silly diffTrees add [email protected] 19 silly decomposeActions action count 8 20 silly decomposeActions fetch [email protected] 21 silly decomposeActions extract [email protected] 22 silly decomposeActions preinstall [email protected] 23 silly decomposeActions build [email protected] 24 silly decomposeActions install [email protected] 25 silly decomposeActions postinstall [email protected] 26 silly decomposeActions finalize [email protected] 27 silly decomposeActions refresh-package-json [email protected] 28 silly install executeActions 29 silly doSerial global-install 8 30 verbose correctMkdir C:\Users\Vinay\AppData\Roaming\npm-cache\_locks correctMkdir not in flight; initializing 31 verbose lock using C:\Users\Vinay\AppData\Roaming\npm-cache\_locks\staging-dfd8fbf9c1feea0f.lock for C:\Program Files\nodejs\node_modules\.staging 32 silly doParallel extract 8 33 silly extract [email protected] 34 silly doReverseSerial unbuild 8 35 silly doSerial remove 8 36 silly doSerial move 8 37 silly doSerial finalize 8 38 silly finalize C:\Users\Vinay\AppData\Roaming\nvm\v8.2.1\node_modules\ocaml-on-windows 39 silly doParallel refresh-package-json 8 40 silly refresh-package-json C:\Users\Vinay\AppData\Roaming\nvm\v8.2.1\node_modules\ocaml-on-windows 41 silly doParallel preinstall 8 42 silly preinstall [email protected] 43 info lifecycle [email protected]~preinstall: [email protected] 44 verbose lifecycle [email protected]~preinstall: unsafe-perm in lifecycle true 45 verbose lifecycle [email protected]~preinstall: PATH: C:\Users\Vinay\AppData\Roaming\nvm\v8.2.1\node_modules\npm\bin\node-gyp-bin;C:\Program Files\nodejs\node_modules\ocaml-on-windows\node_modules\.bin;C:\Program Files\nodejs\node_modules\.bin;G:\cmder\vendor\conemu-maximus5\ConEmu\Scripts;G:\cmder\vendor\conemu-maximus5;G:\cmder\vendor\conemu-maximus5\ConEmu;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\ProgramData\chocolatey\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Fuse\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft Emulator Manager\1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Microsoft DNX\Dnvm\;C:\Users\Vinay\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\dotnet\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Brackets\command;C:\Program Files\Git\cmd;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Yarn\bin;C:\Users\Vinay\AppData\Local\Programs\Python\Python36;C:\Program Files (x86)\Elm Platform\0.17.1\bin;C:\Users\Vinay\.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-update1\bin;C:\Users\Vinay\.dnx\bin;g:\Vinay\Projects\;PATH=C:\ProgramData\Oracle\Java\javapath;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Skype\Phone\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files (x86)\Brackets\command;C:\Program Files\Git\bin;C:\Program Files (x86)\Microsoft;C:\Users\Vinay\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\Vinay\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\Amazon\AWSCLI;C:\Users\Vinay\AppData\Local\Programs\Python\Python36\Scripts;C:\Users\Vinay\AppData\Local\Yarn\bin 46 verbose lifecycle [email protected]~preinstall: CWD: C:\Program Files\nodejs\node_modules\ocaml-on-windows 47 silly lifecycle [email protected]~preinstall: Args: [ '/d /s /c', 'bin\\preinstall.bat' ] 48 silly lifecycle [email protected]~preinstall: Returned: code: 1 signal: null 49 info lifecycle [email protected]~preinstall: Failed to exec preinstall script 50 verbose unlock done using C:\Users\Vinay\AppData\Roaming\npm-cache\_locks\staging-dfd8fbf9c1feea0f.lock for C:\Program Files\nodejs\node_modules\.staging 51 verbose stack Error: [email protected] preinstall: bin\preinstall.bat51 verbose stack Exit status 1 51 verbose stack at EventEmitter.<anonymous> (C:\Users\Vinay\AppData\Roaming\nvm\v8.2.1\node_modules\npm\lib\utils\lifecycle.js:289:16) 51 verbose stack at emitTwo (events.js:125:13) 51 verbose stack at EventEmitter.emit (events.js:213:7) 51 verbose stack at ChildProcess.<anonymous> (C:\Users\Vinay\AppData\Roaming\nvm\v8.2.1\node_modules\npm\lib\utils\spawn.js:40:14) 51 verbose stack at emitTwo (events.js:125:13) 51 verbose stack at ChildProcess.emit (events.js:213:7) 51 verbose stack at maybeClose (internal/child_process.js:921:16) 51 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) 52 verbose pkgid [email protected] 53 verbose cwd C:\Users\Vinay 54 verbose Windows_NT 10.0.15063 55 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "ocaml-on-windows" 56 verbose node v8.2.1 57 verbose npm v5.3.0 58 error code ELIFECYCLE 59 error errno 1 60 error [email protected] preinstall:bin\preinstall.bat`
60 error Exit status 1
61 error Failed at the [email protected] preinstall script.
61 error This is probably not a problem with npm. There is likely additional logging output above.
62 verbose exit [ 1, true ]

Hi Nice Idea

Hi I have tried ocaml-on-windows, but for some reasons (ocamlmerlin seems not in win PATH's). Merlin wasn't started inside vscode.
What do you think, it's possible to make it work?

It's a big goal to make ReasonML run on windows.
Have you reached success with ReasonML?

Do you need any help?

Add bucklescript

One of the things @superherointj has figured out is that, in order for Merlin to work, bucklescript should be running on WSL as well.

The problem that @fhelwanger mentioned in this comment:

Something must have changed lately that is handling \ as an escape char

is due to Bucklescript being executed from Windows, while merlin being executed from Linux, and interpreting file paths differently.

@fhelwanger Would it be very hard to add BuckleScript to this project? I think that would help streamlining the installation on Windows + it would also guarantee that all binaries are "seeing" file paths etc from the same point of view, which would hopefully avoid issues. It makes sense to keep things consistent.

Change project name

This project is actually ocaml on bash on ubuntu on windows ๐Ÿ˜„

Maybe it should be renamed to something like: ocaml-on-wsl-on-windows

cc @superherointj

Update OCaml version

Hello,
Reason now supports OCaml 4.06.1 and Merlin 3.0.5 (according to opam and a bit of personal testing), so it would be nice if you could update bin/preinstall.bat accordingly.

Prompted for password

I have installed the package and it's working in cmd - however whenever I try to run a command it prompts me for the sudo password:

C:\Users\frank>ocaml --version   
[sudo] password for frank:       

The OCaml toplevel, version 4.04.0

Just wondered if anyone knew the best way to avoid the prompt? Thanks

opam config env

The preinstall script should call

eval `opam config env`

instead of

opam config env

install fail, error:Cannot find module '/root/.npm-global/lib/node_modules/bs-platform/scripts/install.js'

PS C:\Users\yu> npm install -g ocaml-reason-wsl

[email protected] preinstall C:\Users\yu\AppData\Roaming\npm\node_modules\ocaml-reason-wsl
bin\preinstall.bat

Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [627 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [252 kB]
0% [Working]

0% [Working]
0% [Working]
Ign:7 https://deb.nodesource.com/node_8.x xenial InRelease
0% [Working]
0% [Working]

Ign:8 https://deb.nodesource.com/node_8.x xenial Release
99% [Working]

99% [Working]
99% [Working]

99% [Working]
Ign:9 https://deb.nodesource.com/node_8.x xenial/main Sources.diff/Index
99% [Working]
99% [Working]

Ign:10 https://deb.nodesource.com/node_8.x xenial/main amd64 Packages.diff/Index
Ign:11 https://deb.nodesource.com/node_8.x xenial/main all Packages
99% [Working]
99% [Working]
99% [Working]
Ign:12 https://deb.nodesource.com/node_8.x xenial/main Translation-en_US
99% [Working]
99% [Working]
99% [Working]
99% [Working]
Ign:13 https://deb.nodesource.com/node_8.x xenial/main Translation-en
99% [Working]
99% [Working]
Ign:14 https://deb.nodesource.com/node_8.x xenial/main Sources
Ign:15 https://deb.nodesource.com/node_8.x xenial/main amd64 Packages
Ign:11 https://deb.nodesource.com/node_8.x xenial/main all Packages
Ign:12 https://deb.nodesource.com/node_8.x xenial/main Translation-en_US
Ign:13 https://deb.nodesource.com/node_8.x xenial/main Translation-en
99% [Working]

99% [Working]
99% [Working]
Ign:14 https://deb.nodesource.com/node_8.x xenial/main Sources
Ign:15 https://deb.nodesource.com/node_8.x xenial/main amd64 Packages
Ign:11 https://deb.nodesource.com/node_8.x xenial/main all Packages
Ign:12 https://deb.nodesource.com/node_8.x xenial/main Translation-en_US
Ign:13 https://deb.nodesource.com/node_8.x xenial/main Translation-en
Ign:14 https://deb.nodesource.com/node_8.x xenial/main Sources
Ign:15 https://deb.nodesource.com/node_8.x xenial/main amd64 Packages
Ign:11 https://deb.nodesource.com/node_8.x xenial/main all Packages
Ign:12 https://deb.nodesource.com/node_8.x xenial/main Translation-en_US
Ign:13 https://deb.nodesource.com/node_8.x xenial/main Translation-en
Hit:14 https://deb.nodesource.com/node_8.x xenial/main Sources
Hit:15 https://deb.nodesource.com/node_8.x xenial/main amd64 Packages
Ign:11 https://deb.nodesource.com/node_8.x xenial/main all Packages
Ign:12 https://deb.nodesource.com/node_8.x xenial/main Translation-en_US
Ign:13 https://deb.nodesource.com/node_8.x xenial/main Translation-en
Ign:11 https://deb.nodesource.com/node_8.x xenial/main all Packages
Ign:12 https://deb.nodesource.com/node_8.x xenial/main Translation-en_US
Ign:13 https://deb.nodesource.com/node_8.x xenial/main Translation-en
Fetched 323 kB in 11min 42s (459 B/s)
Reading package lists... Done
W: The repository 'https://deb.nodesource.com/node_8.x xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
libfreetype6 libuv1
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
m4 is already the newest version (1.4.17-5).
ocaml-nox is already the newest version (4.02.3-5ubuntu2).
opam is already the newest version (1.2.2-4).
The following packages were automatically installed and are no longer required:
libfreetype6 libuv1
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[WARNING] Running as root is not recommended
OPAM has already been initialized.User configuration:
~/.ocamlinit is already up-to-date.
~/.bashrc is already up-to-date.
Global configuration:
~/.opam/opam-init/init.sh is already up-to-date.
~/.opam/opam-init/init.zsh is already up-to-date.
~/.opam/opam-init/init.csh is already up-to-date.
~/.opam/opam-init/init.fish is already up-to-date.
[WARNING] Running as root is not recommended

=-=- Updating package repositories =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Processing 1/1: [default: http]

Processing 1/1: [default: http]

[default] synchronized from https://opam.ocaml.org

Updates available for 4.02.3, apply them with 'opam upgrade':
===== โ†— 1 =====
[WARNING] Running as root is not recommended
[WARNING] Running as root is not recommended
[NOTE] Package reason is already installed (current version is 3.0.4).
[WARNING] Running as root is not recommended
[NOTE] Package merlin is already installed (current version is 2.5.4).

Installing the NodeSource Node.js 8.x LTS Carbon repo...

Populating apt-get cache...

Confirming "xenial" is supported...

Adding the NodeSource signing key to your keyring...

Creating apt sources list file for the NodeSource Node.js 8.x LTS Carbon repo...

Running apt-get update for you...

Run sudo apt-get install -y nodejs to install Node.js 8.x LTS Carbon and npm

You may also need development tools to build native addons:

 sudo apt-get install gcc g++ make

To install the Yarn package manager, run:

 curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
 echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
 sudo apt-get update && sudo apt-get install yarn

Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version (8.11.1-1nodesource1).
The following packages were automatically installed and are no longer required:
libfreetype6 libuv1
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
/root/.npm-global/bin/bsb -> /root/.npm-global/lib/node_modules/bs-platform/lib/bsb
/root/.npm-global/bin/bsrefmt -> /root/.npm-global/lib/node_modules/bs-platform/lib/bsrefmt
/root/.npm-global/bin/bsc -> /root/.npm-global/lib/node_modules/bs-platform/lib/bsc

[email protected] postinstall /root/.npm-global/lib/node_modules/bs-platform
node scripts/install.js

module.js:549
throw err;
^

Error: Cannot find module '/root/.npm-global/lib/node_modules/bs-platform/scripts/install.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: node scripts/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-05-14T13_39_04_608Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] preinstall: bin\preinstall.bat
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\yu\AppData\Roaming\npm-cache_logs\2018-05-14T13_39_04_793Z-debug.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.