npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2 - ionic-framework

$ npm update minimatch#3.0.2
$ npm update -d
npm info it worked if it ends with ok
npm info using npm#2.11.3
npm info using node#v0.12.7
npm info attempt registry request try #1 at 5:33:55 PM
npm http request GET https://registry.npmjs.org/jshint
npm http 200 https://registry.npmjs.org/jshint
npm info ok
$ npm install jshint
npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch#0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
jshint#2.9.2 node_modules\jshint
├── strip-json-comments#1.0.4
├── exit#0.1.2
├── shelljs#0.3.0
├── console-browserify#1.1.0 (date-now#0.1.4)
├── lodash#3.7.0
├── minimatch#2.0.10 (brace-expansion#1.1.5)
├── htmlparser2#3.8.3 (domelementtype#1.3.0, entities#1.0.0, domhandler#2.3.0, d omutils#1.5.1, readable-stream#1.1.14)
└── cli#0.6.6 (glob#3.2.11)

npm install -g minimatch#3.0.2
try this....Should Work

Sorry for the late reply..
sudo npm install
Try this..this works For me to install npm
To update use this..
sudo npm install -g npm#3

Try this (for OSX)
Enter Into Terminal sudo chown -R $USER /usr/local

Works for me downgrading to node v4.4.7 and with sudo chown -R $USER /usr/local in terminal.

I can fix it.
npm install minimatch
+ minimatch#3.0.4
sudo npm install -g minimatch#3.0.4
Try this. It run good for me.

Here, I worked in reactJS with bebel script and try to install npm in my directory. At that time I found this error. I have solved this error by below command.
Run this command in cmd:
npm install browserify babelify babel-preset-env

While chown is one way of going about this, I've always regarded it as the least favorable. Rather than change the owner of system files, it makes more sense to run npm config set prefix $HOME/.node_modules. This will configure npm to look for your node_modules in your home directory, rather than globally.
See https://docs.npmjs.com/getting-started/fixing-npm-permissions.

Related

Unable to install ionic -g

npm ERR! code E404
npm ERR! 404 Not Found: #ionic/cli-framework#0.1.3
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Roaming\npm-cache_logs\2018-05-10T07_52_51_175Z-debug.log
That version of Ionic doesn't exist. Try installing from the versions listed here NPM's Websites
Then npm install -g ionic#3.20.0 for the latest version of ionic
Do you already have an existing version of Ionic?
Try updating your current version or:
sudo npm uninstall -g ionic && sudo npm install ionic
Or:
npm install -g #ionic/cli-framework#3.20.0
As suggested by the other user.
my problem is solved.i uninstall nodejs and remove .npmrc file in C:\Users{user} and then,i reinstall nodejs.This errors is OK.

Install specific branch from github using Npm

I would like to install bootstrap-loader from github in my project using npm
Currently they are maintaining two version of this project which are comaptible with webpack version 1 and 2.
I would like to install version 1. What npm command I should use to install this?
I tried using below one but it is not working.
npm install git://github.com/shakacode/bootstrap-loader.git[#v1] --Save
There are extra square brackets in the command you tried.
To install the latest version from the brach-name branch, you can use:
npm install "https://github.com/shakacode/bootstrap-loader.git#branch-name" --save
npm: npm install username/repo#branchName --save
yarn: yarn add username/repo#branchName
e.g. npm i betimer/rtc-attach#master --save (my username is betimer)
// this will appear in your package.json:
"rtc-attach": "github:betimer/rtc-attach#master"
One thing I also want to mention: it's not a good idea to check in the package.json for the build server auto pull the change. Instead, put the npm i (first command) into the build command, and let server just install and replace the package.
One more note, if the package.json private is set to true, may impact sometimes.
you can give git pattern as version, yarn and npm are clever enough to resolve from a git repo.
yarn add any-package#user-name/repo-name#branch-name
or for npm
npm install --save any-package#user-name/repo-name#branch-name
Another approach would be to add the following line to package.json dependencies:
"package-name": "user/repo#branch"
For example:
"dependencies": {
... other dependencies ...
"react-native": "facebook/react-native#master"
}
And then do npm install or yarn install
I'm using SSH to authenticate my GitHub account and have a couple dependencies in my project installed as follows:
"dependencies": {
"<dependency name>": "git+ssh://git#github.com/<github username>/<repository name>.git#<release version | branch>"
}
Had to put the url in quotes for it work
npm install "https://github.com/shakacode/bootstrap-loader.git#v1" --save
Tried suggested answers, but got it working only with this prefix approach:
npm i github:user/repo.git#version --save -D
Only solution working for me:
$ npm i https://github.com/{USER}/{REPO}/tarball/{BRANCH} --save
as explained here.
Both below versions work for me as of beginning of 2023:
npm i "github:shakacode#bootstrap-loader"
npm i "https://github.com/shakacode/tree/bootstrap-loader/"
The Doc of the npm defines that only tag/version can be specified after repo_url.
Here is the Doc: https://docs.npmjs.com/cli/install

Ionic Package unable install

I have downloaded latest node version 4 and tried to install ionic.
But it was loading for long time in command prompt.
npm install ionic -g
Then I have downloaded 0.10.38 and it started downloading.
Whether ionic supported only in the 0.10 version.
While Installing with higher version getting below error
npm ERR! Windows_NT 6.1.7600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs
node_modules\\npm\\bin\\npm-cli.js" "install" "ionic" "-g"
npm ERR! node v5.0.0
npm ERR! npm v3.3.6
npm ERR! Callback called more than once.
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
C:\Users\<users>\AppData\Roaming\npm
└── (empty)
npm ERR! Windows_NT 6.1.7600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs
node_modules\\npm\\bin\\npm-cli.js" "install" "ionic" "-g"
npm ERR! node v5.0.0
npm ERR! npm v3.3.6
npm ERR! Callback called more than once.
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
C:\Users\<users>\AppData\Roaming\npm
└── (empty)
npm ERR! Windows_NT 6.1.7600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs
node_modules\\npm\\bin\\npm-cli.js" "install" "ionic" "-g"
npm ERR! node v5.0.0
npm ERR! npm v3.3.6
npm ERR! Callback called more than once.
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\Windows\system32\npm-debug.log
npm ERR! code 1
The error message says "node v5.0.0". Make sure you are using Node 4 and not 5. Ionic doesn't yet work with Node 5.x.x. Use node -v to check for version.
First you need to run npm uninstall -g ionic
then install new nodejs vesrion from the https://nodejs.org/en/download/
Once you have completed your latest nodejs installation.
Try to install ionic using
npm install -g ionic
if you are using mac os or ubntu then you can use sudo npm install -g ionic.
On Windows it may be a pain to get a working environment sometimes. To speed up Ops, you can try to use the ionic-box https://github.com/driftyco/ionic-box.
Ionic-Box is a ready-to-go development environment with Ionic, Cordova, and Android.
Steps to install proper nodejs, cordova and ionic may help , try to follow mention below steps
1) Install compatible version of nodejs (windows)
2) Configured path of nodeJs from Computer property Advance environment variable.
3) check npm -v is working
4) run npm install -g cordova
5) if not started configured nodejs/npm to use http instead of https package using ssl false
6)run npm install -g ionic
You can run the following command to downgrade the version :
npm install npm#4.5.0 -g
or
npm install npm#latest -g
You can use Yeoman generator to create your ionic project, which is very easy to use.
here you can find out more :
http://yeoman.io/learning/index.html
to install yeoman :
npm install -g yo
Usage :
Make a new directory, and cd into it
mkdir my-ionic-project && cd $_
Run yo ionic, optionally passing an app name:
yo ionic [app-name]
more information :
https://github.com/diegonetto/generator-ionic
i think u should try this first node.js then commands
$ sudo npm install -g cordova after it completes then install this
$ sudo npm install -g ionic since i used sudo it may ask for password
check weather u done these steps
node.js
npm install -g cordova
npm install -g ionic
ionic --version //to check u have installed correctly
ionic start myapp blank //or tabs or sidemenu
now it will download all required files
check this link https://nodejs.org/en/
Please refer the below link, first you need to install cordova once successfully installed then install ionic.
Link - https://evothings.com/doc/build/cordova-install-windows.html
Hi I have a some problem like this one check this I hope this help you.
https://github.com/ionic-team/ionic-cli/issues/2477
Run this:
npm install --save-dev #ionic/app-scripts

Mean is not recognized as a internal command

npm install -g mean-cli works. but mean init says mean is not recognized as a internal command. How do I fix this?
I installed mean-cli from git, worked like a charm.
Open CMD
Run this: npm install -g git://github.com/djskinner/mean-cli.git
Hope this works for you too
It is possibly a NPM cache issue. Try running the following:
Update NPM
npm update -g npm
Then clear your NPM cache
npm cache clean
Once both commands have successfully ran, continue with the init
mean init <yourAppName>
For more reference material be sure to check out the docs at learn.mean.io.

How to install an npm package from GitHub directly

Trying to install modules from GitHub results in this error:
ENOENT error on package.json.
Easily reproduced using express:
npm install https://github.com/visionmedia/express throws error.
npm install express works.
Why can't I install from GitHub?
Here is the console output:
npm http GET https://github.com/visionmedia/express.git
npm http 200 https://github.com/visionmedia/express.git
npm ERR! not a package /home/guym/tmp/npm-32312/1373176518024-0.6586997057311237/tmp.tgz
npm ERR! Error: ENOENT, open '/home/guym/tmp/npm-32312/1373176518024-0.6586997057311237/package/package.json'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Linux 3.8.0-23-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "https://github.com/visionmedia/express.git"
npm ERR! cwd /home/guym/dev_env/projects_GIT/proj/somename
npm ERR! node -v v0.10.10
npm ERR! npm -v 1.2.25
npm ERR! path /home/guym/tmp/npm-32312/1373176518024-0.6586997057311237/package/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/guym/dev_env/projects_GIT/proj/somename/npm-debug.log
npm ERR! not ok code 0
Because https://github.com/visionmedia/express is the URL of a web page and not an npm module. Use this flavor: git+{url}.git
git+https://github.com/visionmedia/express.git
or this flavor if you need SSH:
git+ssh://git#github.com/visionmedia/express.git
or if you need to install a GitHub Enterprise repository:
git+https://<github enterprise url>/<org>/<repo>.git#<branch>
To install from GitHub, you can also do
npm install visionmedia/express
Or
npm install visionmedia/express#branch
There is also support for installing directly from a Gist, Bitbucket, GitLab, and a number of other specialized formats. Look at the npm install documentation for them all.
If Git is not installed, we can try:
npm install --save https://github.com/Amitesh/gulp-rev-all/tarball/master
As of September 2016, installing from vanilla HTTPS GitHub URLs now works:
npm install https://github.com/fergiemcdowall/search-index.git
You can't do this for all modules because you are reading from a source control system, which may well contain invalid/uncompiled/buggy code. So to be clear (although it should go without saying): given that the code in the repository is in an npm-usable state, you can now quite happily install directly from GitHub.
In October 2019, we are now living through "peak TypeScript/React/Babel", and therefore JavaScript compilation has become quite common. If you need to take compilation into account, look into prepare. That said, NPM modules do not need to be compiled, and it is wise to assume that compilation is not the default, especially for older node modules (and possibly also for very new, bleeding-edge "ESNext"-y ones).
The methods are covered pretty well now in npm's install documentation as well as the numerous other answers here.
npm install git+ssh://git#github.com:<githubname>/<githubrepo.git[#<commit-ish>]
npm install git+ssh://git#github.com:<githubname>/<githubrepo.git>[#semver:^x.x]
npm install git+https://git#github.com/<githubname>/<githubrepo.git>
npm install git://github.com/<githubname>/<githubrepo.git>
npm install github:<githubname>/<githubrepo>[#<commit-ish>]
However, something notable that has changed recently is npm adding the prepare script to replace the prepublish script. This fixes a long-standing problem where modules installed via Git did not run the prepublish script and thus did not complete the build steps that occur when a module is published to the npm registry. See Run prepublish for Git URL packages #3055.
Of course, the module authors will need to update their package.json file to use the new prepare directive for this to start working.
There's also npm install https://github.com/{USER}/{REPO}/tarball/{BRANCH} to use a different branch.
The current top answer by Peter Lyons is not relevant with recent NPM versions. For example, using the same command that was criticized in this answer is now fine.
npm install https://github.com/visionmedia/express
If you have continued problems it might be a problem with whatever package you were using.
The general form of the syntax is
<protocol>://[<user>[:<password>]#]<hostname>[:<port>][:][/]<path>[#<commit-ish> | #semver:<semver>]
which means for your case it will be
npm install git+ssh://git#github.com/visionmedia/express.git
From npmjs docs:
npm install :
Installs the package from the hosted git provider, cloning it with
git. For a full git remote url, only that URL will be attempted.
<protocol>://[<user>[:<password>]#]<hostname>[:<port>][:][/]<path>[#<commit-ish>
| #semver:] is one of git, git+ssh, git+http,
git+https, or git+file.
If # is provided, it will be used to clone exactly that
commit. If the commit-ish has the format #semver:,
can be any valid semver range or exact version, and npm will look for
any tags or refs matching that range in the remote repository, much as
it would for a registry dependency. If neither # or
semver: is specified, then master is used.
If the repository makes use of submodules, those submodules will be
cloned as well.
If the package being installed contains a prepare script, its
dependencies and devDependencies will be installed, and the prepare
script will be run, before the package is packaged and installed.
The following git environment variables are recognized by npm and will
be added to the environment when running git:
GIT_ASKPASS
GIT_EXEC_PATH
GIT_PROXY_COMMAND
GIT_SSH
GIT_SSH_COMMAND
GIT_SSL_CAINFO GIT_SSL_NO_VERIFY
See the git man page for details.
Examples:
npm install git+ssh://git#github.com:npm/npm.git#v1.0.27
npm install git+ssh://git#github.com:npm/npm#semver:^5.0
npm install git+https://isaacs#github.com/npm/npm.git
npm install git://github.com/npm/npm.git#v1.0.27
GIT_SSH_COMMAND='ssh -i ~/.ssh/custom_ident' npm install git+ssh://git#github.com:npm/npm.git npm install
You can do:
npm install git://github.com/foo/bar.git
Or in package.json:
"dependencies": {
"bar": "git://github.com/foo/bar.git"
}
This works for me and it is less typing.
npm i github:<UserName>/<RepoName>
package.json
{
"dependencies": {
"name": "github:<UserName>/<RepoName>"
}
}
Install it directly:
npm install visionmedia/express
Alternatively, you can add "express": "github:visionmedia/express" to the "dependencies" section of package.json file, then run:
npm install
You could also do
npm i alex-cory/fasthacks
or
npm i github:alex-cory/fasthacks
Basically:
npm i user_or_org/repo_name
Sometimes I need to install from a specific branch or commit.
To make things simple I just use https://gitpkg.vercel.app/
You can directly install a GitHub repository by the npm install command, like this:
npm install https://github.com/futurechallenger/npm_git_install.git --save
NOTE: In the repository which will be installed by npm command:
maybe you have to have a dist folder in you repository, according to Dan Dascalescu's comment.
You definitely have to have a package.json in your repository! Which I forget add.
Simple:
npm install *GithubUrl*.git --save
Example:
npm install https://github.com/visionmedia/express.git --save
I tried npm install git+https://github.com/visionmedia/express but that took way too long and I wasn't sure that would work.
What did work for me was - yarn add git+https://github.com/visionmedia/express.
Below piece of code worked for me to install from github repository:
npm install git+ssh://<your_repository_ssh_clone_link>#<branch_name_if_any>
You can get ssh clone link as below:
So for above screenshot repository, you may need to import as below,
npm install git+ssh://git#github.com:Siddhu2/calculator-chatbot.git#master
where master is my branch and it is optional since I have only one branch.
If you get something like this:
npm ERR! enoent undefined ls-remote -h -t https://github.com/some_repo/repo.git
Make sure you update to the latest npm and that you have permissions as well.
The only command that worked for me was npm i MY_PACKAGE_NAME:MY_REPOSITORY#BRANCH_NAME
No need to do much; this helped me:
Yarn add <git_name>:<github_name>/<Repository_name>.git
Example:
yarn add git#github.com:myGitHub/dynamic-checkbox-input.git
And if you want to add some specific commit or branch name then add #.
Example:
yarn add git#github.com:myGitHub/dynamic-checkbox-input.git#master
Example:
yarn add git#github.com:myGitHub/dynamic-checkbox-input.git#c978U57
Yarn 2 requires the package name along with the Github repository. Read the documentation of Yarn's CLI.
Example: yarn add <package_name>git#github.com:<owner_name>/<package_name>.git
Try this command:
npm install github:[Organisation]/[Repository]#[master/BranchName] -g
This command worked for me:
npm install github:BlessCSS/bless#3.x -g