NPM recursive Unmet peer dependency - javascript

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

Related

npm related tasks are throwing errors during installations

I've been having this problem recently that nothing related to npm is working for me except npm start.
npm install is giving this error:
$ npm install #material-ui/core
npm ERR! Object for dependency "#babel/generator" is empty.
npm ERR! Something went wrong. Regenerate the package-lock.json with "npm install".
npm ERR! If using a shrinkwrap, regenerate with "npm shrinkwrap".
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Parth\AppData\Roaming\npm-cache\_logs\2020-08-20T13_52_13_701Z-debug.log
npx create-react-app ./ is giving this error:
npx create-react-app ./
npx: installed 98 in 10.023s
Creating a new React app in G:\hel.
Installing packages. This might take a couple of minutes. Installing
react, react-dom, and react-scripts with cra-template...
yarn add v1.22.4 [1/4] Resolving packages... [2/4] Fetching
packages... error An unexpected error occurred: "UNKNOWN: unknown
error, unlink
'C:\\Users\\Parth\\AppData\\Local\\Yarn\\Cache\\v6\\npm-core-js-pure-3.6.4-4bf1ba866e25814f149d4e9aaa08c36173506e3a-integrity\\node_modules\\core-js-pure\\features\\object\\is-frozen.js'".
info If you think this is a bug, please open a bug report with the
information provided in "G:\\hel\\yarn-error.log". info Visit
https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation. yarnpkg add --exact react react-dom
react-scripts cra-template --cwd G:\hel has failed.
Deleting generated file... package.json Deleting generated file...
yarn.lock Done.
EDIT: So I tried using Yarn for my installs but got this error:
$ yarn add #material-ui/core
yarn add v1.22.4
warning package-lock.json found. Your project contains lock files generated by
tools other than Yarn. It is advised not to mix package managers in order to
avoid resolution inconsistencies caused by unsynchronized lock files. To clear
this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "UNKNOWN: unknown error, unlink
'C:\\Users\\Parth\\AppData\\Local\\Yarn\\Cache\\v6\\npm-core-js-pure-3.6.4-4bf1ba866e25814f149d4e9aaa08c36173506e3a-integrity\\node_modules\\core-js-pure\\features\\object\\is-frozen.js'".
info If you think this is a bug, please open a bug report with the information
provided in "F:\\Parth\\covid-19-tracker\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
How do I fix this?
Edit: My version of npm is 6.14.8
First of all you need to make sure that your node and npm versions are up to date. if not please upgrade your node and npm packages to latest versions.
nvm install 12.18.3 // update node version through node version manager
npm install npm // update your npm version to latest
Delete your node_modules folder, package-lock.json and yarn file (if you have).
Force clean the entire NPM cache by using following comand.
npm cache clean --force
Re-Install all the dependencies.
npm install
If above step didn't resolve your problem, try to uninstall yarn globally by delete the Yarn folder from global folder and then run.
npm uninstall -g yarn

npm ERR! Cannot find module './access-error.js'

Anything I try to do with NPM, I end up with npm ERR! Cannot find module './access-error.js'. Help!
I first noticed it when trying to install vue-chartjs. I ran npm install vue-chartjs chart.js --save like the docs said to do and got the error:
code/premium-poker-tools [master●] » npm install vue-chartjs chart.js --save
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module './access-error.js'
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/adamzerner/.npm/_logs/2019-03-12T23_56_46_114Z-debug.log
Then I tried installing chart.js and vue-chartjs individually, but it gives me the same error.
Then I googled the issue. I tried:
rm -rf node_modules
npm install
and it didn't work.
I tried reinstalling NPM and it didn't work. I tried removing NPM via sudo npm uninstall npm -g and then planning on reinstalling it after, and it didn't work. Everything I do gives me the npm ERR! Cannot find module './access-error.js' error.
This problem sounds very similar to one I had a few weeks ago.
What worked for me was removing Node.js from my Mac and reinstalling it, because installing Node.js installs npm as well.
Command used to remove Node.js: sudo rm -rf /usr/local/{bin/{node,npm},lib/node_modules/npm,lib/node,share/man/*/node.*}
Then just reinstall Node.js and everything should work again!
Hope this helps!
Ran into the same issue. Was using Node v8.11.4. Switched to Node v8.9.4 and it started working again...
Using NVM, I did the following:
nvm ls
nvm install <different version>
nvm alias default <different version>
Best guess is that it wasn't 8.11 specifically, but something with my particular installation was messed up and using a fresh install fixed it.
Not very satisfying. ¯\_(ツ)_/¯
I faced the same problem. Found that the node version is different.
Try the following:
1. nvm ls
2. nvm use <latest version available>
Now baam .. it works.

How to install gulp jshint using npm?

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

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.

npm install couldnt install angularjs libraries

I have installed mean.io and ran sudo npm install. Actually following commands in sequence
sudo npm install -g meanio
mean init yourNewApp
cd yourNewApp
sudo npm install -g bower
sudo npm install
It is supposed to download and install angularjs libraries into public/system/lib. After doing the above steps public /system/lib is not created due to which when I start the application I get the error
events.js:72
throw er; // Unhandled 'error' event
^
Error: ENOENT, open '/home/santhosh/dev/scaleqa/mean_tut/old mean/temp/myapp/public/system/lib/bootstrap/dist/css/bootstrap.css'
[nodemon] app crashed - waiting for file changes before starting...
Is it something to do with certain npm/angularjs server being down. I have faced this problem earlier also but got fixed on 2nd try and I didn't bother to do more research. This became a big issue when I try to pull my repo into cloud and start the application. public/system/lib is added in .gitignore by default and is expected to be created during npm install.
I get following warnings with sudo npm install
npm WARN package.json mean-connect-mongo#0.4.3 No repository field.
npm WARN cannot run in wd mean#0.3.3 node node_modules/bower/bin/bower install (wd=/home/santhosh/dev/scaleqa/mean_tut/old mean/temp/myapp)
this is link to package.json
The problem maybe related to running npm install as sudo, which can cause problems. As mentioned in another stack overflow question, this can be worked around in a couple ways. But because it looks like this is being run from your home directory, you really shouldn't need to run npm install as root.
Try to issue the same commands, but the last without sudo:
sudo npm install -g meanio
mean init yourNewApp
cd yourNewApp
sudo npm install -g bower
npm install
Note that the reason you may need to run npm install -g <package> using sudo is because by default npm uses /usr/local for global installs, which can be a restricted directory. However, when you install a package locally (without the -g flag) you should not need to run as root.

Categories

Resources