Vue js & node js installed. Version also showing but not starting - javascript

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

Related

Npm run dev doesnt start up nuxt 3 local server

My Nuxt app was initially built with Nuxt2, but recently I had some errors with ESlint and I was forced to upgrade and migrate the application to Nuxt3.
However on migrating, the application local server doesn't startup with the startup script. Below is an image showing the output when running npm run dev
Nodejs : 18^
nuxtjs: 3^
vuejs: 2.7^
Nuxt3 is using Vue3, not Vue2.7.
Also, your app is fine when you run npm run dev so you don't need to run npm nuxi dev per-se.
You could run npx nuxi-edge#latest dev as suggested here.
That one works thanks to npx not npm, which is quite different. npx doesn't need you to have the package installed locally or globally on the system, it can fetch the whole code remotely and run it on the fly straight away.
Still, in your case: use npm run dev, it's all good that way.
No need to run it through npx/nuxi, that just adds delay.

"'npm' is not recognized as an internal or external command" on create-react-app

Why is npm not recognized?
I'm trying to learn react and get started using it. I have node installed, and the package create-react-app.
If I type in my command line, npm -v or create-react-app -V, it will return the current versions I have. Which is step one in my problem.
Step two would be checking the environment paths.
I have C:\Users\hunte\AppData\Roaming\npm in my paths and I even ran my bash command line as administrator with no such luck.
Step three I assume would be restarting my computer. (Obviously it didn't work)
How I installed and tried to step up react is like this...
npm install -g create-react-app
create-react-app my-app
Then it returns 'npm' is not recognized as an internal or external command.
I'm lost, looking for some help to resolve this as I really eager to learn react.js.
Thank's to all who spend the time reading my question.
Here's my cmd
$ create-react-app test
Creating a new React app in C:\Users\hunte\desktop\test\test.
'npm' is not recognized as an internal or external command,
operable program or batch file.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
'npm' is not recognized as an internal or external command,
operable program or batch file.
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts#0.9.x has failed.
Deleting generated file... package.json
Deleting test/ from C:\Users\hunte\desktop\test
Done.
I've figured it out!
For everyone who runs into a similar problem all I did to get it to work was change CMDs.
I was using the Git Bash CMD as I like it better; however, I guess it doesn't work well with the system paths/environments.
All I did to fix this issue to run my default cmd as administrator and tried again. This time it worked and I was successful in creating the react package.
Using the default Command Prompt worked for me. I was previously working on Hyper.

Why does grunt not work when installed globally?

I have installed grunt and grunt-cli globally using sudo npm install -g grunt... commands.
My working folder is `/opt/web', please don't ask why :)
Checking grunt version inside `/opt/web' works:
$ grunt --version
grunt-cli v0.1.13
However, I can't actually run a grunt task from there:
$ grunt
grunt-cli: The grunt command line interface. (v0.1.13)
Fatal error: Unable to find local grunt.
If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project.
If I install grunt locally, it then asks to install all it's dependencies locally (that are already installed globally (!)).
This behavior seems strange to me.
My question is:
Is this a bug or a feature? Is this by design that grunt wants to work with locally installed things only?
This is by design. See the grunt-cli readme.
The cli doesn't do anything except find and run a local copy of grunt.
This means that each project can use a version of grunt that the project specifies and is know/tested to work correctly. Given the number of critical things grunt can do, this compatibility promise is a big deal.
There is also a good blog post on the node site that talks a bit more about module installation locations.

Installing Google js test for unit testing

I am currently working on JavaScript and want to design unit test for JavaScript I am using google-JS-Test
http://code.google.com/p/google-js-test/
I have downloaded gjstest-1.0.7
I have installed all the prerequisites need.
http://code.google.com/p/google-js-test/wiki/Installing#Prerequisites
but when I install google js test using
$ cd gjstest-1.0.7
$ make
I got following errors
g++ -DHASH_NAMESPACE=__gnu_cxx -lrt -I. -I/usr/include/libxml2 -DDEFAULT_DATA_DIR=/usr/local/share/gjstest -c -o gjstest/internal/cpp/v8_utils.o gjstest/internal/cpp/v8_utils.cc
gjstest/internal/cpp/v8_utils.cc:33: error: ‘v8::StackFrame’ has not been declared
gjstest/internal/cpp/v8_utils.cc:34: error: ‘v8::StackTrace’ has not been declared
gjstest/internal/cpp/v8_utils.cc: In function ‘void gjstest::ConvertToStringVector(const v8::Handle<v8::Value>&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*)’:
gjstest/internal/cpp/v8_utils.cc:60: error: no matching function for call to ‘v8::Array::Get(uint32&)’
/usr/include/v8.h:1161: note: candidates are: v8::Local<v8::Value> v8::Object::Get(v8::Handle<v8::Value>)
make: *** [gjstest/internal/cpp/v8_utils.o] Error 1
It seems like v8 is not install correctly
I have installed V8 using commands like
sudo apt-get install libv8-2.0.3
sudo apt-get install libv8-dbg
sudo apt-get install libv8-dev
And also by downloading it
svn checkout http://v8.googlecode.com/svn/trunk/ v8
cd v8
make dependencies
scons
But still getting these errors
So if any one has installed and used Google Js or installed v8, kindly guide me on how should I solve this problem.
I am using Ubuntu 10.04.
Any help will be appreciated.
This is indeed caused by trying to build gjstest against a very old version of libv8.
I checked out and built a more recent libv8 on ubuntu 10.04 by following the instructions here:
svn checkout http://v8.googlecode.com/svn/trunk/ v8
cd v8
make depdendencies
make native library=shared
cp out/native/lib.target/libv8.so /usr/local/lib/libv8.so
cp include/v8.h /usr/local/include/v8.h
cp include/v8stdint.h /usr/local/include/v8stdint.h
After which gjstest compiled and ran without further surprises.

Rails - Could not find a JavaScript runtime?

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

Categories