Bucklescript 5.0 released

See https://bucklescript.github.io/blog/ for more details.
The cool thing is that you can try it out within 20s everywhere using cloud service like https://c9.io/
npm i -g bs-platform && bsb -init test && cd test && bsb


The headline here is that Linux, Windows and Mac binaries are pre-built now, so installs should be really quick! This will particularly speed up CI builds.

Does not even install:

sudo npm i -g bs-platform
/usr/bin/bsb -> /usr/lib/node_modules/bs-platform/lib/bsb
/usr/bin/bsrefmt -> /usr/lib/node_modules/bs-platform/lib/bsrefmt
/usr/bin/bsc -> /usr/lib/node_modules/bs-platform/lib/bsc

bs-platform@5.0.0 postinstall /usr/lib/node_modules/bs-platform
node scripts/install.js

throw err;

Error: EACCES: permission denied, copyfile ‘/usr/lib/node_modules/bs-platform/vendor/ninja/snapshot/ninja.linux’ -> ‘/usr/lib/node_modules/bs-platform/lib/ninja.exe’
at Object.copyFileSync (fs.js:1723:3)
at provideNinja (/usr/lib/node_modules/bs-platform/scripts/install.js:85:16)
at Object. (/usr/lib/node_modules/bs-platform/scripts/install.js:263:1)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
npm ERR! errno 1
npm ERR! bs-platform@5.0.0 postinstall: node scripts/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bs-platform@5.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

can you try sudo npm i -g --unsafe-perm bs-platform

1 Like

Assuming you’re using a personal computer, you should just take ownership of that directory hierarchy:

$ sudo chown -R jbulow /usr/lib/node_modules

Then global install should work:

$ npm install --global bs-platform

Thanks, --unsafe-perm fixed the problem.

This is not a problem with bucklescript but rather npm. There is a section in npm’s documentation to fix this error

1 Like

I was going to suggest adding a note to the docs, but looks like it’s already there: https://bucklescript.github.io/docs/en/installation#permission-denied-errors