Comments (10)
I'm still having issues with this on Ubuntu 18 LTS. Get a ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime.
when I've got node
binary available but not the nodejs
binary. Using execjs
gem with commit hash f6dc08c58ab4e1a467f64d471ee6e0127c2f14de
as I noticed there were a few merged PRs (that might've solved the problem) ahead of release version 2.7.0
.
$ which node
/usr/local/bin/node
$ node --version
v10.16.0
$ nodejs --version
The program 'nodejs' is currently not installed. To run 'nodejs' please ask your administrator to install the package 'nodejs'
Tried both of metaskills suggestions, they don't seem to solve the issue.
Creating a symlink from the nodejs
binary to node
does work, but it feels a bit dirty, and is an odd step to add to infrastructure setup:
sudo ln -s "$(which node)" /usr/bin/nodejs
To echo others thoughts, would be nice if ExecJS found node
itself, even when nodejs
is not present.
from execjs.
Is a PR for this issue welcome?
from execjs.
I've seen the open pull-request to address this problem, but the issue goes further.
I could not get execJS to work on my Linux Mint system, with nodenv installed.
Only after installing nodejs through the package manager I actually got this working.
So even if execJS has support to look for node, on a linux environment it doesn't even get to that point because it throws the exception that no suitable runtime exists when nodejs is not available.
from execjs.
This is an issue that is affecting me as well using the Heroku multi-buildpack (Node + Ruby) on a base image that already comes with an ancient version of Node installed:
bash-4.3# node -v
v10.15.0
bash-4.3# nodejs -v
v0.10.25
Is there a way to force ExecJS to choose node
in this case?
from execjs.
That's a good question @moubry. From reading the source, I think something like this might work?
# In config/initializers/execjs
silence_warnings do
ExecJS::Runtimes.const_set :Node, ExecJS::ExternalRuntime.new(
name: "Node.js (V8)",
command: ["node"],
runner_path: ExecJS.root + "/support/node_runner.js",
encoding: 'UTF-8'
)
end
from execjs.
Or maybe less invasive.... something like this?
# In config/initializers/execjs
ExecJS::Runtimes::Node.instance_variable_set :@command, ['node']
from execjs.
Any updates on this? I'm thinking of just symlinking the binary for as a temporary workaround but I'd love ExecJS to handle this itself!
from execjs.
Hopefully #84 fixes it. Can someone cut a new release?
from execjs.
I'm still having issues with this on Ubuntu 18 LTS. Get a
ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime.
when I've gotnode
binary available but not thenodejs
binary. Usingexecjs
gem with commit hashf6dc08c58ab4e1a467f64d471ee6e0127c2f14de
as I noticed there were a few merged PRs (that might've solved the problem) ahead of release version2.7.0
.$ which node /usr/local/bin/node $ node --version v10.16.0 $ nodejs --version The program 'nodejs' is currently not installed. To run 'nodejs' please ask your administrator to install the package 'nodejs'
Tried both of metaskills suggestions, they don't seem to solve the issue.
Creating a symlink from the
nodejs
binary tonode
does work, but it feels a bit dirty, and is an odd step to add to infrastructure setup:sudo ln -s "$(which node)" /usr/bin/nodejs
To echo others thoughts, would be nice if ExecJS found
node
itself, even whennodejs
is not present.
Can confirm linking works.
/usr/bin/nodejs -> /home/vagrant/.nvm/versions/node/v13.14.0/bin/node
Ubuntu 18.04.5 LTS
rvm 1.29.10
ruby 2.3.1p112
rails (= 4.2.6)
whenever (0.9.7)
execjs-2.7.0
[email protected]
[email protected]
from execjs.
This should have been fixed with #84.
from execjs.
Related Issues (20)
- Version 2.8.0 may require ES6 syntax HOT 2
- v2.8.0 changelog? HOT 4
- Rails 4.2 + v2.8.1 == TypeError: Cannot read property 'version' of undefined HOT 1
- ExecJS::RuntimeUnavailable in el7
- 2.8.1: ExecJS.compile consistently exits 1 in one environment and 0 elsewhere. HOT 4
- Can't use runtime because `File.executable?` returns false HOT 5
- What is better? V8 or node.js? HOT 1
- An example in the README doesn't work HOT 1
- Setup bun.sh runtime HOT 3
- Popen的encoding参数要改成utf8才能正常运行,但我不想修改subprocess.py的源码,有什么方式可以解决吗 HOT 1
- bun.sh as runtime HOT 4
- How to debug ExecJS::RuntimeError: SyntaxError: Invalid or unexpected token HOT 1
- Syntax error with new HEREDOC syntax HOT 3
- required_ruby_version is incorrect HOT 1
- Bun runtime fails if there's an `.env` file in the working directory HOT 2
- Changelog HOT 2
- `rails server` fails using Dockerfile generated by `rails new`, bun and execjs HOT 1
- Can't call a function with "NaN" input when using MiniRacer HOT 2
- External runtimes broken on Ruby 3.0 HOT 6
- Version 2.8.0 raises ExecJS::ProgramError: TypeError: Cannot read property 'version' of undefined HOT 44
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from execjs.