kirti#kirti-Vostro-14-3468:~/flipbook-vue$ node --version
v17.6.0
kirti#kirti-Vostro-14-3468:~/flipbook-vue$ vue --version
#vue/cli 5.0.1
kirti#kirti-Vostro-14-3468:~/flipbook-vue$ npm run serve
> flipbook-vue#0.10.4 serve
> vue-cli-service serve
sh: 1: vue-cli-service: not found
kirti#kirti-Vostro-14-3468:~/flipbook-vue$
System: Ubuntu 20.04
Via: Downloaded via terminal.
I'm running a GitHub repo on my system. I saw the instructions for directly running a github repo on VS Code but as it gave me this error.
I thought, to verify and install vue & node properly first and then run. But, it still gives me error. What can I do?
restart your system it may help sometime it is important to restart your system after installing nodejs
I tried to install SpiderMonkey 45 in Ubuntu 16.04, but I failed. I refered to SpiderMonkey Build Documentation and finished the make process.
cd js/src
autoconf-2.13
mkdir build_DBG.OBJ
cd build_DBG.OBJ
../configure --enable-debug --disable-optimize
make
After the installation, when I change the directory to ../build_DEBUG.OPT/js/src/shell and type js, the terminal gave me an error:
The program 'js' can be found in the following packages:
* nodejs
* rhino
Try: sudo apt install <selected package>
How to solve the problem? Thank you very much.
Calling js directly looks in your PATH environment variable for an executable called js. Since the directory that you built Spidermonkey in isn't in your path, the executable isn't found, causing an error.
./js expands to <your current directory>/js, which is specific enough for your terminal to find the executable and run it.
See this question for a more general explanation as to why ./executable works but executable doesn't.
I am trying to set up the JavaScript code tester Karma, but when I run the command to initialise karma I get the error 'usr/bin/env: node: No such file or directory'. How can I fix it?
As per #digitalmediums
I've found this is often a misnaming error, if you install from a package manager you bin may be called nodejs so you just need to symlink it like so "sudo ln -s /usr/bin/nodejs /usr/bin/node"
sudo ln -s /usr/bin/nodejs /usr/bin/node
this worked for me.
node is a reserved term in ubuntu thus node.js is actually nodejs.
I found a similar question with same issue here
Usually the non packaged node version (not nodejs) that the user installs can be run from /usr/local/bin/node
as
#!/usr/local/bin/node
I created a new Rails project using rails 3.1.0.rc4 on my local machine but when I try to start the server I get:
Could not find a JavaScript runtime. See here for a list of available runtimes. (ExecJS::RuntimeUnavailable)
Note: This is not about Heroku.
Installing a javascript runtime library such as nodejs solves this
To install nodejs on ubuntu, you can type the following command in the terminal:
sudo apt-get install nodejs
To install nodejs on systems using yum, type the following in the terminal:
yum -y install nodejs
Note from Michael 12/28/2011 - I have changed my accept from this (rubytheracer) to above (nodejs) as therubyracer has code size issues. Heroku now strongly discourage it. It will 'work' but may have size/performance issues.
If you add a runtime, such as therubyracer to your Gemfile and run bundle then try and start the server it should work.
gem 'therubyracer'
A javascript runtime is required for compiling coffeescript and also for uglifier.
Update, 12/12/2011: Some folks found issues with rubytheracer (I think it was mostly code size). They found execjs (or nodejs) worked just as well (if not better) and were much smaller.
n.b. Coffeescript became a standard for 3.1+
Add following gems in your gem file
gem 'therubyracer'
gem 'execjs'
and run
bundle install
OR
Install Node.js to fix it permanently for all projects.
sudo apt-get install nodejs does not work for me. In order to get it to work, I have to do the following:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
Hope this will help someone having the same problem as me.
On the windows platform, I met that problem too
The solution for me is just add
C:\Windows\System32
to the PATH
and restart the computer.
I had this issue on a Windows machine and installing node.js was the solution that finally worked for me. This came after trying multiple other routes including trying to get 'therubyracer' working. Though the github for node.js suggests that installation on windows is still unstable, the website at http://nodejs.org/ had a Windows installer which worked perfectly.
if you already install nodejs from source for example, and execjs isn't recognizing it you might want to try this tip: https://coderwall.com/p/hyjdlw
If all fails you can try
# aptitude install nodejs
as root. You can test your install with the following command:
# node -v
If you want to install NPM, please refer following link. Hope it helps.
On CentOS 6.5, the following worked for me:
sudo yum install -y nodejs
Install a Javascript runtime
The error is caused by the absence of a Javascript runtime on your local machine. To resolve this, you'll need to install NodeJS.
You can install NodeJS through the Node Version Manager or nvm:
First, install nvm:
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
Install Node through nvm:
nvm install 5.9.1
This will install version 5.9.1 of Node.
I ran into this issue using Phusion Passenger (running as an nginx module) on a Redhat server. We already had a Javascript runtime installed. Other Rails apps in the same parent directory worked fine.
It turned out that we had a permissions issue. Run "ls -l" and see if the folder has the same owner and group as other working apps on the system. I had to run chown and chgrp on the folder (with the recursive switch) to fix it.
I hope you have pre-installed nodejs || nmv.
My solution does not require gem setup or installing 'node with sudo apt" when you already have nvm.
All you need is to edit DesctopEntry of RubyMine. for that we will have those small steps:
Go to usr/share/applications
Open in any editor (i use vim ) Rubymine DesktopEntry vim RubyMine
Edit line 6 (starts with Exec). You shoud add to beginning /bin/bash -i -c. So your line should look like this
Exec=/bin/bash -i -c "/home/USERNAME/rubymine/RubyMine-2019.1.2/bin/rubymine.sh" %f
Done! You are glorious!
As a benefit all your environment variables are now available for RubyMine. So you feel no pain with additing them.
On MacOS try running:
brew install node
brew link node
To force the link and overwrite all conflicting files:
brew link --overwrite node
node -v
What is an easy-to-use free JavaScript minifier running in Ubuntu?
It should be easy to install as well. ;-)
I'm using the YUI Compressor
Check JSMin:
https://bitbucket.org/dcs/jsmin/
Install it with:
sudo apt-get install python-pip
sudo pip install jsmin
Usage as CLI:
python -m jsmin myfile.js
For example:
python -m jsmin large1.css large2.css > minified.css
As library:
from jsmin import jsmin
with open('myfile.js') as js_file:
minified = jsmin(js_file.read())
Use Closure Compiler
Documentation: Getting started
I recommend using some Javascript task runners such as Grunt or Gulp, if you dont want to use any task runners, just install Node in your ubuntu by
git clone https://github.com/joyent/node.git
cd node
./configure
make
sudo make install
Once the installation is complete
Just install a package called "minifier" via NPM ( node package manager )
npm install -g minifier
g in the above command is to make this package available globally throughout the system .
Once the installation is complete you can just run the below command to minify your javascript.
minify --output path/to/output/file path/to/inputfile
Some times using Google Closure compiler, creates lot of problem, Since it throws lot of compiler errors by checking against standards,But still it does a great job, sometimes we will not be in a position to fix those ECMA standard issues displayed by google closure. :)
Hope this post helps other folks who are facing similar issue.