Just starting with JavaScript. Do I have to have Lite Server or can I use VS Code's Liveserver extension instead? Any research I've done on the topic leads into node.js, package.json, and NPMs which I don't understand.
If Lite Server is needed, do you install it through terminal/command line or do you have to install it in the html document you want to apply it to? Thanks.
They are both pretty similar and for your purposes, VSCode's Live server will work fine for you especially if you are not familiar with npm, node, and do not have a package.json.
If you would like to learn more about npm and what a package.json is check this out.
Related
I recently developed a tool that I would like to share with the community. It consists of one JS file.
According to my logic, it should work like this:
npm i -g npm-defect
npm-defect ...
I already uploaded the library to NPM, but I don’t know how to make it so that it can be called from the console.
Tell me how to compile the program correctly so that it can be run that way.
Thank you!
you can use npx, npx npm-defect , check this link to see how it works npx doc , or if you would like to package it as an executable use a node.js packager like vercel pkg
Does it is needed to install npm ethereumjs-tx while using a browser version of it which is directly downloaded from github.
If yes then how we can import the ethereumjs-tx module in our script file.
Because both are two different things as my knowledge.
ethereumjs-tx as a browser build can be found here
If it helps anyone in the future. EthereumJS community have created browser builds for most of their repositories here. Please use with caution as it has not been updated regularly. But they have put instructions on how to create a build for the latest versions over here
The project I am working on, works in the development environment. But when I deploy it live and navigate to the site, I only see blank screen.
I get the following errors in the console (from both development and production environment)
The same error exists in the development and production environments. The different is, I can navigate through the site pages in the development environment. But I only see a blank screen in the production environment.
I tried to update my jQuery to the latest version using the following command:
meteor npm install --save jquery meteor-node-stubs
But I still get the same error.
What am I doing wrong here?
This issue cost me some time to work out. Basically you need to find a sweet spot for jquery.
Meteor loads jquery by default, and in .meteor/packages I have jquery#1.11.10, which is probably what Meteor puts in for you.
You will also need to load a version somewhere in between that works. For me this command did the trick:
meteor npm install jquery#2.2.4
Cheers
I'm sorry if this doesn't count as a "Programming Question" but I found it relevant since this will make me able to do programming in the Podio API.
My question/problem is that I can't figure out the correct way to set up the Podio JavaScript SDK/API scripts. I followed "http://podio.github.io/podio-js/" but it really only explains so much.. Mostly about Node and that I need to use Node for it, but isn't there another way like simple Ajax calls?
Reason being, I don't have the possibility of running a Node server in my server background, just to make API calls, it may be effective but it sounds kind of stupid when so many other API's out there doesn't require this.
Thoughts?
podio-js is a Podio JavaScript SDK for node and the browser.
... which means you don't necessary need Node.js. To use NPM module in the browser you'll need a bundler, like Webpack:
npm install podio-js --save
npm install webpack --save-dev
Then in your app.js:
var podio = require('podio-js');
// follow the tutorial
To bundle the app:
./node_modules/.bin/webpack app.js app.bundle.js
Then include the bundle in your HTML via script tag and voilà:
<script src="app.bundle.js"></script>
I like the look of meteor, never tried it before, thought it would make a great platform for a web dashboard on my raspberry pi. Tried the recommended installer and got this:
$ curl install.meteor.com | /bin/sh
Unable to install Meteor on unsupported architecture: armv6l
Installation failed.
Well, I'm not gonna take that lying down! Am going to try and manually install it, but has anyone tried/failed/succeeded already? Any tips?
Apparently, there are prebuilt packages for raspi now. Alas, I lost interest long ago - details of prebuilt packages here: http://meteor-universal.tumblr.com/
(Thanks to #Archonic - see the comments below - and if you'd like to make that a real answer, I'd be happy to change the accepted answer for this question.)
I'll keep the text below for reference.
(Updating as I go along...)
Note: i'm doing this on the stock debian image, albeit after having installed ruby, passenger and padrino (and all their dependencies). Archlinux may be easier, I don't know.
Install node.js
Does not work by default, followed instructions here
Checkout meteor
git clone git://github.com/meteor/meteor.git
modify admin/generate-dev-bundle.sh
Essentially, remove all the instructions regarding building node.js, and all references to a tempdir, so you end up just installing node packages. I will post mine as a gist once it's all figured out...
Then, run it in an empty folder
install mongodb. From source.
cd to extracted directory, and install using scons
sudo apt-get install scons libboost-all-dev
scons libboost-dev libpcre++-dev xulrunner-1.9.1-dev
(Note: I will be finishing this soon. I think the trick might be to use meteor's bundle functionality - especially the big red box http://docs.meteor.com/#deploying - but unfortunately my pi has crashed and I'm away from home. Please post if you found that worked, and I'll update this answer accordingly or accept your answer)
You can find a fork of meteor at github called Meteor universal fork. That has a ready to go installer for yet unsupported architectures like ARM and BSD.
For the installation just run:
cd $HOME
git clone --depth 1 https://github.com/4commerce-technologies-AG/meteor.git
and then get the binaries and finish the installation by:
$HOME/meteor/meteor --version
Running the above command for the first time will try to download a compatible pre-built dev_bundle and finish the installation. Depending on your hardware this may take some time.