I'm getting the following warning when using 'create-react-app': npm WARN prefer global marked#0.3.6 should be installed with -g
How can I get rid of this warning?
I looked at "Question that may already have your answer" and didn't seem to find a precise answer. However, I'm new and may have overlooked the obvious.
My installs are:
$ npm -v
4.3.0
$ node --version
v7.0.0
$ npm list -g create-react-app
/usr/local/lib
└── create-react-app#1.2.1
$ npm list -g marked#
/usr/local/lib
└── marked#0.3.6
It looks to me that this package is already installed globally.
I ran the following:
$ sudo npm update -g create-react-app
which resulted in the following:
$ npm list -g create-react-app
/usr/local/lib
└── create-react-app#1.3.0
However, I still get:
npm WARN prefer global marked#0.3.6 should be installed with -g
Because that package includes the CLI.
Try to remove and install create-react-app to the newest version 1.3.0
npm install -g create-react-app
Related
Please I need your help whenever I try to install anything with npm I always get errors please help me.
Update
From what read from the docs you should install the #ionic/cli
$ npm install -g #ionic/cli
From the docs:
If there was a previous installation of the Ionic CLI, it will need to be uninstalled due to a change in package name.
$ npm uninstall -g ionic
$ npm install -g #ionic/cli
You may want to add debug info while installing e.g.:
$ npm install -dd -g #ionic/cli
From your screenshot not sure if there is an error with your GIT config, or permissions to install the ionic cli globally on your machine...
Outdated
There should not be a space between ionic and #4, you should run e.g.:
npm install -g ionic#4
You can try with command like this npm install -g ionic#{{version}}.
In the place of version you should put your prefered version.
When I try to install gatsby running npm install gatsby-cli -g , it shows that is successfuly installed but it does not work when I run gatsby --help oder gatsby -- build .... , it shows:
-bash: gatsby: command not found
the reason you are getting that is that you haven't installed it globally
$ npm i -g gatsby
$ source ~/.bashrc
source will refresh your terminal so you don't need to close it and open it up again
cli commands only work with globally installed packages
The Gatsby CLI is available via npm and should be installed globally by running:
npm install -g gatsby-cli
If you are unable to successfully run the Gatsby CLI due to a permissions issue, you may want to check out the npm docs on fixing permissions.
global flag -g comes first while installing any package
instead of npm install gatsby-cli -g run npm i -g gatsby-cli
any of below will work
npm install --global <package_name_to_install>
npm install -g <package_name_to_install>
npm i --global <package_name_to_install>
npm i -g <package_name_to_install>
for you package_name_to_install is gatsby-cli
I’m using 9.6.1 version of node, it goes with 5.6.0 version of npm.
I’m trying to install Angular with follow command:
$ npm i --no-optional -g #angular/cli
But is returned the follow message: npm WARN sass-loader#6.0.6 requires a peer of node-sass#^4.0.0 but none is installed. You must install peer dependencies yourself.
I have installing node-sass like this:
$ npm i --no-optional -g node-sass#^4.0.0
And it installs well.
So I run $ npm i --no-optional -g #angular/cli again, but the warning continues.
If I installing without -g flag, everything happens well, but I need to install globally to use ng command.
Here are the steps I did to set up my project:
$ git clone ssh:<project>
$ cd <project>
$ nvm install 5.0
$ nvm use 5.0
I then check my node version and it appears to be correct: v5.0.0.
$ npm install
$ npm install -g react-native-cli
This all seems to go according to plan, and locally, it gives me a tree with all the correct dependencies.
When I do npm list --depth=0 -g, I get expected results.
├── npm#3.3.6
└── react-native-cli#1.0.0
So I try to run the npm start script, which is react-native start. However, whenever I try to run it, I get the following basic error:
Looks like you installed react-native globally, maybe you meant react-native-cli?
To fix the issue, run:
npm uninstall -g react-native
npm install -g react-native-cli
I've tried just about everything I can think of, down to uninstalling node and nvm completely and starting from scratch.
What is the solution to this problem?
This upcoming error message is not very helpful. Besides your npm installation issue I found also an npm start doesn't work after upgrade to 0.15.0 bugfixing issue with the same error message.
First of all you should check the symbolic link shown after npm install:
$ npm install -g react-native-cli
/usr/local/bin/react-native -> /usr/local/lib/node_modules/react-native-cli/index.js
Check if the linked file exists:
ls /usr/local/lib/node_modules/react-native-cli/index.js
If not, check your npm path settings with
npm config list
or directly in ~/.npmrc
In my case I had a wrong prefix in ~/.npmrc, which I've deleted completely. As the npm ERR! message shows after another npm install -g react-native-cli, it came up with:
npm ERR! Refusing to delete /usr/local/bin/react-native: ../lib/node_modules/react-native/local-cli/wrong-react-native.js symlink target is not controlled by npm /usr/local
npm ERR! File exists: /usr/local/bin/react-native
npm ERR! Move it away, and try again.
Look at the indicated 'wrong-react-native.js' filename at the end.
Delete that link, do a npm update and try npm install -g react-native-cli again.
Worked on MacOS X. npm installed with homebrew
I'm trying to install Yeoman via npm, but I get the following errors when I run npm install -g yo:
npm WARN deprecated npmconf#2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
/home/marieficid/.node/bin/yo -> /home/marieficid/.node/lib/node_modules/yo/lib/cli.js
> yo#1.6.0 postinstall /home/marieficid/.node/lib/node_modules/yo
> yodoctor
Yeoman Doctor
Running sanity checks on your system
✔ Global configuration file is valid
✖ Node.js version
Your Node.js version is outdated.
Upgrade to the latest version: https://nodejs.org
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✖ npm version
Your npm version is outdated.
Upgrade to the latest version by running:
npm install -g npm
✔ NODE_PATH matches the npm root
Found potential issues on your machine :(
/home/marieficid/.node/lib
└── yo#1.6.0
Which is very odd because when I run node --version && npm --version I get:
v4.3.1
3.7.3
And when I try to run npm install -g n I get:
/home/marieficid/.node/bin/n -> /home/marieficid/.node/lib/node_modules/n/bin/n
/home/marieficid/.node/lib
└── n#2.1.0
I tried running this solution, which only brought me more issues: Now I can't run node --version, only n --version, which returns 2.1.0, and I can't run npm install -g n because I get this:
marieficid#mariana-K46CB:~$ npm install -g n
/usr/bin/env: node: Arquivo ou diretório não encontrado
Which means "directory not found". What can I do? I'm on Ubuntu 14.04, by the way.
EDIT: I think I screwed up my $PATH variable... does anyone know how to fix it?
You should run
npm install -g npm
not
npm install -g n
according to your output