How to install gulp jshint using npm? - javascript

Unable to install JSHint. Can anyone suggest me what I am doing wrong?
I am using below command.
npm install --save-dev gulp-jshint gulp-jscs jshint-stylish
It is showing the following "gulp-jshint#2.0.4 requires a peer of jshint#2.x but none was installed-UNMET peer dependency"

Try executing the following command npm install --save-dev jshint gulp-jshint gulp-jscs jshint-stylish

peer dependency is not installed by npm you must install it manually before.
In your case :
npm install --save-dev jshint
Update
Peer dependency is a dependency for a library that is not required. It is considered as a plugin.
You can find more informations here for npm or here for nodejs

Related

Eslint uninstall

I uninstall eslint from my system by running two commands i.e
npm uninstall eslint --save-dev (to remove it from the package .json)
npm uninstall eslint
But after doing all this when I run this command npm eslint -v, it shows me the version of the eslint.
How do I completely remove eslint from my system?
Try to check globally installed packages using the below command:
npm list -g
And if you find eslint in the list then try to use this command:
npm uninstall -g eslint --save
checkout this link if this didn't work: https://www.codegrepper.com/code-examples/javascript/how+to+uninstall+eslint

how to install package under (as) peerDependencies?

I'm building a library and trying to understand how to install/specify a dependency under peerDependencies.
The npm docs don't talk about this under the command npm install:
npm install (with no args, in package dir)
npm install [<#scope>/]<name>
npm install [<#scope>/]<name>#<tag>
npm install [<#scope>/]<name>#<version>
npm install [<#scope>/]<name>#<version range>
npm install <git-host>:<git-user>/<repo-name>
npm install <git repo url>
npm install <tarball file>
npm install <tarball url>
npm install <folder>
alias: npm i
common options: [-P|--save-prod|-D|--save-dev|-O|--save-optional] [-E|--save-exact] [-B|--save-bundle] [--no-save] [--dry-run]
Any help?
As far as I know, there isn't a command line shortcut for installing a peer dependency. Some Googling dug up this old issue where the npm folks briefly discussed adding that functionality, but it doesn't seem to have been made it in as of npm#6.
It's less-than-ideal, but I think manually editing your package.json file to specify peer dependencies by hand may be your best bet. As of this 2013 blog post from the Node.js team, that approach almost seems sanctioned:
Peer dependencies are pretty simple to use. When writing a plugin, figure out what version of the host package you peer-depend on, and add it to your package.json: ...

NPM recursive Unmet peer dependency

I'm trying to upgrade my #ionic-native/core so I can install an OIDC client.
No matter what commands I tried I am returned an error:
UNMET PEER DEPENDENCY #ionic-native/core#4.5.2
I've tried:
npm update #ionic-native/core#4.5.2 --save
npm update #ionic-native/core#latest --save
npm uninstall #ionic-native/core --save
npm install #ionic-native/core --save
All of these return that same error, which is weird because how can #ionic-native/core#4.5.2 be a dependency of itself?
In case anyone else encounters this issue. Some how when I was running one of the NPM Commands a duplicate dependency was added to my package.Json for #ionic-native/core#4.5.2 with an older version.
Once I removed the duplicate line from the package.Json everything started to work fine again

Getting error while creating new Angular 2 project

I install AngularJs using the command npm install -g angular-cli and afterwards, when I was trying to create new project, I get the following error,
Cannot find module 'reflect-metadata'
What should I for resolve the error ?
I had to reintall nodeJS from their website and install reflect-metadata and portfinder using the following commands while being as superuser,
sudo npm install -g reflect-metadata
sudo npm install -g portfinder
Afterwards, I can create new project using the command,
ng new myProject
Upgrade npm by npm install -g npm.
If problem still exists try:
npm i -g reflect-metadata
Re-installing node.js worked for me.

Installing Angular-CLI on Windows 10

I had installation issues of angular-cli on Windows 10 system.
The errors were related to Python dependencies and node-gyp. Something as below :
>execSync#1.0.2 install C:\Users\UserName\AppData\Roaming\npm\node_modules\angular-cli\node_modules\execSync
node install.js
[execsync v1.0.2] Attempting to compile native extensions.
{ Error: spawn node-gyp ENOENT
at exports._errnoException (util.js:1007:11)
Update
this seems to be fixed in newer releases and this solution is no longer required.
mukesh51 eventually solved the problem.
the installation seems to work in these steps:
npm install -g node-gyp
npm install -g windows-build-tools
npm install -g #angular/cli
I took these steps from here.
Uninstall
npm uninstall -g angular-cli
npm uninstall --save-dev angular-cli
Update Global package
npm uninstall -g #angular/cli
npm cache clean
npm install -g #angular/cli#latest
I too faced the same issue initially when I installed angular directly using bash. The installation was error completely. Then I attempted to install locally in my project (without removing the global one). That appeared to have solved the problem but got an error on creating a new app.
So i uninstalled everything :
npm uninstall -g #angular/cli
and the reinstalled Angular using Windows Power Shell(as Admin)
npm install -g #angular/cli
This solved the entire problem! Hope it helps!
Use windows power shell to install angular-cli. It will run without any issues.
Windows 10 Solution
Look back at the trace of installation steps ... you may see that it found the Angular binary in the following location:
C:\Program Files\Git\usr\local\node_modules\#angular\cli\bin
I added an ENVT variable using this path and ng worked fine after that
I tried using npm install -g #angular/cli
npm downloaded files successfully and copied files to AppData but not able to use ng -v
After that, I tried following:
npm cache clean --force
Removes npm cache forcefully if you get warning using npm cache clean.
Then try
npm install -g #angular/cli#latest
I have successfully installed by trying the above solution in Windows10.
Both the CLI and generated project have dependencies that require Node 8.9 or higher, together with NPM 5.5.1 or higher.
try update node.js and npm
npm uninstall -g #angular/cli
npm install -g #angular/cli
if doesn't work:
Close the terminal, open a new one or use CMD or Git for windows instead.

Categories

Resources