How do I run a program that I git cloned? - javascript

I'm new to git. I just git cloned this library and am trying to run the code in this folder. I know that it uses Javascript so I tried using npm start but it gave me a npm ERR! missing script: start error. How do I run it?

You should use the Getting Started guide on their docs. You are meant to install the package via npm and not cloning it using git. You would only clone the repo if you intend on modifying their code.
2.1 How to Install
This charts library is intended to be installed with npm and the built into your project with a tool like Webpack. It expects React to be present, as well as our TimeSeries abstraction library, pond.js. More on this below.
To install:
npm install react-timeseries-charts pondjs --save

Related

Bumping package-lock.json and packge.lock at the same time?

Prior to publishing to NPM I need to bump the minor version. What I usually do is:
- Change package.json
- Run npm i which syncs package-lock.json with the change. Now both can be published.
Is there a way to do this with a single NPM command?
Use npm version.
For example, the following command
npm version 1.0.2
will bump both package.json and package-lock.json to 1.0.2
The following command
npm i -S <module>#<version>
installs the specific version of the given module.
-S or --save tells npm to save the reference of the module + version into both package.json and package-lock.json
It depends on the granularity of control you want to have. For example, if you just want to check for an update on an individual module you can run: npm update <pkg>. As this command will update your package.json file to save the newest version of this <pkg> as the now required version to build your project. Alternatively, you could run npm update to update all your project's top-level packages. Ok so those are the more general use cases but if you want a specific version of a package and you know the version of which you desire you can do the following: npm i --save <pkg>#<version> as this command will grab the package specified by your version number as well as update the package.json file to include this version of package as now being required to build your project. This will eliminate the need to first update the package.json file and then installing the newer version of said package, rather this will be condensed down to one step. Lastly, just for thoroughness the package-lock.json file is dynamically generated when you make important changes to your project, such as requiring new dependencies or updating existing dependencies. This file kind of serves as source of truth so others can build your project and have the same setup as you, for more information on this file take a look at the npm docs
Hopefully that helps!

What is difference between npm install and meteor npm install

I am working on Meteor and want to know that what is the difference between
npm install and meteor npm install.
Thanks
According to Meteor Development Group's comments in the official forum, the difference is as follows;
meteor npm calls the bundled npm version, so it doesn’t require npm to be installed globally, That is just a convenience however, so if you do have npm installed using that will work perfectly fine. That being said, it is a good practice to get into always using meteor npm, as that way you can make sure you’re using the same npm version that has been tested with your current version of Meteor.
When using meteor npm you can make sure that you are using the same npm version that has been tested with your current Meteor's version.
When using npm install it just uses the global npm on your machine. So i'd advise to use meteor npm
This may help you to understand difference between npm install and meteor npm install
The former is installing npm packages, which will be listed in packages.json and located in the node modules directory and need to be imported into your code.
The latter is using atmosphere packages which will be listed under .meteor/packages and will be included in your build (no need to import).

How can I update the package.json using meteor add?

How can I get my package.json updated by meteor add command as it can be achieved by npm install --save?
I just read there that meteor writes in the .meteor/package. Does that mean package.json can only be updated via npm install --save whereas meteor add only effects .meteor/package?
I'll highly appreciate detailed information on that.
There are two ways of adding packages to a meteor project.
With meteor add
With npm install
These are two separate ways of managing packages, and one doesn't affect the other.
If you install, for example, jquery with meteor add, you'd use import {$} 'meteor/jquery' to use in a file.
If you use npm install to install jquery, then you might use import $ from 'jquery'.
Don't confuse npm packages with meteor packages.

How do I fix missing #angular/Core modules?

I can not run the Angular 2 project.
What I tried:
- running the project by using npm install and npm start | does not work
- I cloned quickstart from the github and replaced with my src folder and I still get the "can not find module in #angular/core"
Here is the full console output: https://www.dropbox.com/s/5plmqrjd6ge0lta/error.txt?dl=0
Many people will come here. I have had the same problem. Do not panic. You are probaly following the tutorial of tutorialspoint.
Just install the core again using NPM
npm install #angular/core
There was/is a bug in certain versions of npm that causes installed modules to disappear when using npm install someModule ... or npm install someModule --save-dev
This was apparently an issue if the module being installed was from a GitHub repo and lacked a specific commit hash to reference for the installation. Although the issue was marked "closed" and the repo archived several months ago at v5.6.0, I ran into the problem today w/the latest npm 6.4.0
In my case, doing npm install rxjs completely removed the #angular/core module, along with my #ionic-native plugins, and anything else I'd installed individually (and then it failed to actually/properly install rxjs anyway!!)
Tip: copy your existing npm modules folder as a backup before starting updates or removing it entirely & trying to npm install.
You can manually install to your project via npm install #angular/core, but depending on the npm version (or the angle of the moon at that precise moment, who knows) be aware that you might wind up with other missing dependencies.
Also try npm install #angular/core && npm install ... Apparently the additional npm install helps replace the randomly deleted/missing modules in some cases.

Installing a library using npm

I've a question regarding how to use a js library that is installed via npm. I have a simple webapp that compiles using gulp, so I installed the library using --save to populate my package.json but now what? should I add it as a gulp task too? I am not clear about all this process. Thanks
Almost always, libraries installed using npm i --save are ready to be require()d right out of the box.
The gulp tasks you might see on a library's source in GitHub is for developers of that library to build and test the library locally.
npm has utilities for running all of the build tools automatically before the library is published (with npm publish) and while the consumer's (yours) npm install is running.

Categories