bsansouci / reprocessing-example

79 stars 29 forks source link

Conflict with global bs-platform #24

Open Schmavery opened 4 years ago

Schmavery commented 4 years ago

From https://reasonml.chat/t/is-reprocessing-alive/2045/10 cc @jdeisenberg

reasonlab> rm -rf reprocessing-example
reasonlab> !?clone
git clone https://github.com/bsansouci/reprocessing-example.git
Cloning into 'reprocessing-example'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 215 (delta 2), reused 0 (delta 0), pack-reused 209
Receiving objects: 100% (215/215), 486.29 KiB | 5.40 MiB/s, done.
Resolving deltas: 100% (106/106), done.
reasonlab> cd reprocessing-example
reprocessing-example> ls
bsconfig.json  index.html  package.json  README.md  require_polyfill.js  src
reprocessing-example> npm install

> sdl2@2.0.5 postinstall /home/david/reasonlab/reprocessing-example/node_modules/sdl2
> node postinstall.js

No pre-built binaries for linux, downloading source
Unzip successful.                          
Building from source, will take a minute or two.
Looks like SDL2 built successfully.

> bsb-native@4.0.1100 postinstall /home/david/reasonlab/reprocessing-example/node_modules/bsb-native
> node postinstall.js

Unzip successful.                            
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN reprocessing-example@ No repository field.
npm WARN reprocessing-example@ No license field.

added 11 packages from 8 contributors and audited 15 packages in 50.28s
found 0 vulnerabilities

reprocessing-example> npm run build

> reprocessing-example@ build /home/david/reasonlab/reprocessing-example
> bsb -make-world

bs-platform version mismatch Running bsb 4.0.11 (/home/david/reasonlab/reprocessing-example/node_modules/bsb-native) vs vendored 6.2.1 (/home/david/.nvm/versions/node/v11.7.0/lib/node_modules/bs-platform)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! reprocessing-example@ build: `bsb -make-world`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the reprocessing-example@ build 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!     /home/david/.npm/_logs/2019-12-04T01_41_48_361Z-debug.log
Schmavery commented 4 years ago

Not exactly sure what's happening, I guess node doesn't let you have a node package globally installed that conflicts with a local package's version?

tracymedcalf commented 4 years ago

I'm having the same problem. @Schmavery any suggestions?

Ctrlmonster commented 4 years ago

Hey, I'm running into the same problem. Any news?

Schmavery commented 4 years ago

The long-term answer is that we've been working to try and get the changes in bsb-native upstreamed into bucklescript here: https://github.com/BuckleScript/bucklescript/pull/3762

I'm not sure what the specific bug is in this case, unfortunately the only workaround I'm aware of currently is not globally installing bs-platform.

bsansouci commented 4 years ago

Hey all! Sorry about this, I'm guessing you're all on linux? We're working on figuring out what's going on to see if we can fix it soon

spike7638 commented 4 years ago

Any progress here? I'd love instructions for the "not globally installing" solution if that is something that would get me to a working state...

bsansouci commented 4 years ago

Hey @spike7638 sorry for the long-ass wait. So I’d recommend nuking your global install of bs-platform by doing npm global remove bs-platform and then install bsb-native locally: npm install bsb-native@4.0.7000 That version should work better than the latest.

spike7638 commented 4 years ago

Thanks...I'll give that a try. And thanks for the details -- I'm still learning the arguments/options to both npm and bsb. :(

Ctrlmonster commented 4 years ago

Sorry for the delayed answer. Thanks for the workaround. And yes, I'm on Linux. Cheers

spike7638 commented 2 years ago

OK. I'm trying once again Just for the record, I'm on a Mac, v 12.0.1. Using your advice from April 3, combined with what worked for me a while ago (see Dec '19 discussion in https://reasonml.chat/t/is-reprocessing-alive/2045/4), I tried this:

% npm uninstall -g bsb
% mkdir foo
% cd foo
% git clone https://github.com/bsansouci/reprocessing-example.git
% cd reprocessing-example
% npm install bsb-native@4.0.7000
> bsb-native@4.0.7000 postinstall /Users/jfh/Desktop/foo/reprocessing-example/node_modules/bsb-native
> node postinstall.js

/Users/jfh/Desktop/foo/reprocessing-example/node_modules/bsb-native/postinstall.js:22
let version = JSON.parse(fs.readFileSync("package.json")).version;
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:148:18)
    at node.js:405:3
npm WARN reprocessing-example@ No repository field.
npm WARN reprocessing-example@ No license field.
npm ERR! Darwin 21.1.0
npm ERR! argv "/Users/jfh/.nvm/versions/node/v5.12.0/bin/node" "/Users/jfh/.nvm/versions/node/v5.12.0/bin/npm" "install" "bsb-native@4.0.7000"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! code ELIFECYCLE

npm ERR! bsb-native@4.0.7000 postinstall: `node postinstall.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the bsb-native@4.0.7000 postinstall script 'node postinstall.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bsb-native package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node postinstall.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs bsb-native
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls bsb-native
npm ERR! There is likely additional logging output above.

and got the results you see. Sadly, everything related to Javascript is a mystery to me, so I have no idea what's going on here. But I also tried following the instructions in the README (https://github.com/bsansouci/reprocessing-example/blob/master/README.md) and failed in essentially the same way. It might improve the Readme slightly if, after the git clone, you had us change directory (cd reprocessing-example/) before running npm install . But that's clearly not the main problem here.