LiquidPlayer / LiquidCore

Node.js virtual machine for Android and iOS
MIT License
1.01k stars 127 forks source link

node: command not found [iOS] #158

Open daetal-us opened 4 years ago

daetal-us commented 4 years ago

I've been trying to track down a way to reliably inject an environment variable or update PATH used by xcodebuild when kicking off phasescriptexecution for LiquidCore.

It appears the root cause of my problems are that I'm using nvm and so my node bins are not global. I was trying to figure out a more elegant solution, i.e. specifying NODE_BIN or NODE_BIN_PATH etc as a user defined environment variable in build settings (in particular those appear to be ignored when building modules) or the like but keep hitting walls.

I'm mostly creating this issue for posterity and for any other poor souls down the line as it seems the ideas I was exploring might not even be possible at the moment according to a related thread.

Anyway, I suppose I'll just give up for now and add a symlink in /usr/local/bin.

ericwlange commented 4 years ago

Interesting. I am also using nvm and it never occurred to me that the build script is ignoring that.

This is the only place that it matters, though, no? You could change the line to:

s.script_phase = { :name => 'Bundle JavaScript Files', :script => '(cd ..; nvm use 10.15.3; node node_modules/liquidcore/lib/cli.js bundle --platform=ios)' }

Including the nvm use xxx line should do what you want but I haven't tried it.

Is there somewhere else it causes a problem?

chepix10 commented 3 years ago

I found this thread on Stackoverflow and this command helped me on Android Studio. Maybe it can work on Xcode too. ln -s $(which node) /usr/local/bin/node