Default location change for npm bin - command-line

I want to change the npm bin and npm bin -g locations.
How can I do that from the command line?
When npm is installed, the package prefers a location other than /usr/bin.

try this.
$-g/npmrc or -c/npmrc
-g =global
-C =prefix
refer this link https://docs.npmjs.com/misc/config#command-line-flags

Related

conan installed but no command found

Installation is successful but where is conan?
Installed using "sudo pip install conan" (success)
source ~/.profile
conan (No command 'conan' found)
I looked with "pip show conan" and it returns location is /usr/local/lib/python3.5/dist-packages
It seems after you installed conan with pip / pip3 it is not in the environment variable PATH. You need to find where conan was installed and add path to conan to PATH.
find /usr/local -name conan
and if conan was installed to /usr/local/bin
add it to PATH
PATH=$PATH:/usr/local/bin
It is possible that you want to update your ~/.profile or ~/.bashrc to add path to conan to PATH.

Cpplint could not find executable

I am trying to activate cpplint within vs code. I have installed it in Anacanda environment where executable
/home/ubuntu/anaconda3/bin/cpplint
I have a link to it
ls -l /home/ubuntu/anaconda3/bin/cpplint
Unfortunately per visual code cpplint extension still getting error of "Cpplint could not find executable"
Please, advice to configure it correctly.
Download and install
sudo apt-get install python-pip
pip install --user cpplint
Verify install result
ls -l /usr/local/bin/cpplint
If you still have issues check cpplint.cpplintPath and verify the execution path is set correctly.
Also, if you installed cpplint into ~/.local/ directories, by default ~/.local/bin is not included in PATH. So to fix just that add:
export PATH=$PATH:~/.local/bin/
to your ~/.bashrc

npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2

$ 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.

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 can I run madge on Windows

The instructions for madge are only good for a linux system (it requires sudo to get the command line part set up). Is there a way to run it on windows?
It turns out to be very simple. To install madge:
npm install madge
Then to set it up for the command line:
npm -g install madge
You can then run it with a command of:
madge
For typescript generate .js files do:
madge -f amd -c .
and you'll get the circular report. You need the "-f amd".