Vs code not working in my linux npm err sowing? - node.js

protons#protons-HP-EliteBook-840-G3:~/Desktop/NH_Facility_Portal_V0$ sudo npm install
[sudo] password for protons:
npm notice
npm notice New minor version of npm available! 8.12.1 -> 8.13.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.13.2
npm notice Run npm install -g npm#8.13.2 to update!
npm notice
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-otp-input#2.4.0
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"17.0.2" from the root project
npm ERR! peer react#">=16.0.0" from #ant-design/icons#4.7.0
npm ERR! node_modules/#ant-design/icons
npm ERR! #ant-design/icons#"^4.7.0" from the root project
npm ERR! 77 more (#emotion/react, #emotion/styled, #icons/material, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.2.0" from react-otp-input#2.4.0
npm ERR! node_modules/react-otp-input
npm ERR! react-otp-input#"^2.3.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#16.14.0
npm ERR! node_modules/react
npm ERR! peer react#"^16.2.0" from react-otp-input#2.4.0
npm ERR! node_modules/react-otp-input
npm ERR! react-otp-input#"^2.3.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /root/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-07-01T06_16_23_962Z-debug-0.log
protons#protons-HP-EliteBook-840-G3:~/Desktop/NH_Facility_Portal_V0$ ^C
protons#protons-HP-EliteBook-840-G3:~/Desktop/NH_Facility_Portal_V0$ npm install -g npm#8.13.2
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! dest /usr/local/lib/node_modules/.npm-i9nnxROI
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/npm' -> '/usr/local/lib/node_modules/.npm-i9nnxROI'
npm ERR! [Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/npm' -> '/usr/local/lib/node_modules/.npm-i9nnxROI'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/usr/local/lib/node_modules/npm',
npm ERR! dest: '/usr/local/lib/node_modules/.npm-i9nnxROI'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/protons/.npm/_logs/2022-07-01T06_20_59_076Z-debug-0.log
protons#protons-HP-EliteBook-840-G3:~/Desktop/NH_Facility_Portal_V0$ sudo npm install -g npm#8.13.2
changed 24 packages, and audited 202 packages in 4s
11 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
protons#protons-HP-EliteBook-840-G3:~/Desktop/NH_Facility_Portal_V0$ sudo npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-otp-input#2.4.0
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"17.0.2" from the root project
npm ERR! peer react#">=16.0.0" from #ant-design/icons#4.7.0
npm ERR! node_modules/#ant-design/icons
npm ERR! #ant-design/icons#"^4.7.0" from the root project
npm ERR! 77 more (#emotion/react, #emotion/styled, #icons/material, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.2.0" from react-otp-input#2.4.0
npm ERR! node_modules/react-otp-input
npm ERR! react-otp-input#"^2.3.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#16.14.0
npm ERR! node_modules/react
npm ERR! peer react#"^16.2.0" from react-otp-input#2.4.0
npm ERR! node_modules/react-otp-input
npm ERR! react-otp-input#"^2.3.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /root/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-07-01T06_22_32_536Z-debug-0.log
protons#protons-HP-EliteBook-840-G3:~/Desktop/NH_Facility_Portal_V0$ ^C
protons#protons-HP-EliteBook-840-G3:~/Desktop/NH_Facility_Portal_V0$ npm fund
natty_hatty_facility_portal#0.1.0
protons#protons-HP-EliteBook-840-G3:~/Desktop/NH_Facility_Portal_V0$

First delete package-lock.json and node_modules folder
then run
npm install --legacy-peer-deps
or
sudo npm install --legacy-peer-deps

try with :
npm install --legacy-peer-deps

Run the following command.
sudo npm intall --force

Related

Cannot install under npm packages anymore

When I want to install something under npm then I get an error. I try to fix it so many ways but failed. Here is the error
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: undefined#undefined
npm ERR! Found: #nomiclabs/hardhat-ethers#0.3.0-beta.13
npm ERR! node_modules/#nomiclabs/hardhat-ethers
npm ERR! dev #nomiclabs/hardhat-ethers#"npm:hardhat-deploy-ethers" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev #nomiclabs/hardhat-waffle#"^2.0.3" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: #nomiclabs/hardhat-ethers#2.1.1
npm ERR! node_modules/#nomiclabs/hardhat-ethers
npm ERR! peer #nomiclabs/hardhat-ethers#"^2.0.0" from #nomiclabs/hardhat-waffle#2.0.3
npm ERR! node_modules/#nomiclabs/hardhat-waffle
npm ERR! dev #nomiclabs/hardhat-waffle#"^2.0.3" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Mazhar\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Mazhar\AppData\Local\npm-cache\_logs\2022-09-11T23_40_30_606Z-debug-0.log
PS C:\Users\Mazhar\Documents\Alchemy-weekly\nft-marketplace-scratch>

npm install command is showing too many error message

I need to install node in my project by running this command:
npm install
But after run this command I am getting this error message:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: browser-sync-webpack-plugin#2.0.1
npm ERR! Found: webpack#4.46.0
npm ERR! node_modules/webpack
npm ERR! peer webpack#"^4.0.0" from #intervolga/optimize-cssnano-plugin#1.0.6
npm ERR! node_modules/#intervolga/optimize-cssnano-plugin
npm ERR! #intervolga/optimize-cssnano-plugin#"^1.0.5" from #vue/cli-service#4.5.17
npm ERR! node_modules/#vue/cli-service
npm ERR! dev #vue/cli-service#"~4.5.13" from the root project
npm ERR! 5 more (#vue/cli-plugin-babel, #vue/cli-plugin-eslint, ...)
npm ERR! peer webpack#"^4.0.0 || ^5.0.0" from #soda/friendly-errors-webpack-plugin#1.8.1
npm ERR! node_modules/#soda/friendly-errors-webpack-plugin
npm ERR! #soda/friendly-errors-webpack-plugin#"^1.7.1" from #vue/cli-service#4.5.17
npm ERR! node_modules/#vue/cli-service
npm ERR! dev #vue/cli-service#"~4.5.13" from the root project
npm ERR! 5 more (#vue/cli-plugin-babel, #vue/cli-plugin-eslint, ...)
npm ERR! 28 more (#vue/cli-plugin-babel, #vue/cli-plugin-eslint, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack#"^1 || ^2 || ^3" from browser-sync-webpack-plugin#2.0.1
npm ERR! node_modules/browser-sync-webpack-plugin
npm ERR! browser-sync-webpack-plugin#"2.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: webpack#3.12.0
npm ERR! node_modules/webpack
npm ERR! peer webpack#"^1 || ^2 || ^3" from browser-sync-webpack-plugin#2.0.1
npm ERR! node_modules/browser-sync-webpack-plugin
npm ERR! browser-sync-webpack-plugin#"2.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/hello/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/hello/.npm/_logs/2022-10-06T12_31_49_438Z-debug-0.log
Would you please tell me why it's showing this error message and how can I solve it ?
Run npm install --legacy-peer-deps
This question has already been answered here.

Installing nest/terminus gives dependency tree error

Whenever I try to install nest/terminus
npm i #nestjs/terminus
I get the following error
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: typeorm#0.3.7
npm ERR! Found: ioredis#4.28.5
npm ERR! node_modules/ioredis
npm ERR! peer ioredis#"^4.0.0" from #nestjs-modules/ioredis#1.0.1
npm ERR! node_modules/#nestjs-modules/ioredis
npm ERR! #nestjs-modules/ioredis#"^1.0.1" from the root project
npm ERR! ioredis#"^4.28.5" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional ioredis#"^5.0.4" from typeorm#0.3.7
npm ERR! node_modules/typeorm
npm ERR! peertypeorm#"^0.3.0" from #nestjs/typeorm#8.1.4
npm ERR! node_modules/#nestjs/typeorm
npm ERR! #nestjs/typeorm#"^8.1.4" from the root project
npm ERR! typeorm#"^0.3.7" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: ioredis#5.2.1
npm ERR! node_modules/ioredis
npm ERR! peerOptional ioredis#"^5.0.4" from typeorm#0.3.7
npm ERR! node_modules/typeorm
npm ERR! peer typeorm#"^0.3.0" from #nestjs/typeorm#8.1.4
npm ERR! node_modules/#nestjs/typeorm
npm ERR! #nestjs/typeorm#"^8.1.4" from the root project
npm ERR! typeorm#"^0.3.7" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
I tried running the following command
npm install --save --legacy-peer-deps
it ran okay, but on repeating the terminus installation I got the same error. Any idea what I might be doing wrong?

Error when trying to npm install -g #aws-amplify/cli

new to this, I'm trying to install aws amplify from the command line and it keeps throwing me an err messages: I tried sudo, tried the safe route to no avail. I'm new to node and understanding dependencies etc. and not sure what I've done wrong!
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: graphql#14.7.0
npm ERR! node_modules/#aws-amplify/cli/node_modules/graphql
npm ERR! graphql#"^14.5.8" from #aws-amplify/amplify-category-api#1.1.10
npm ERR! node_modules/#aws-amplify/cli/node_modules/#aws-amplify/amplify-category-api
npm ERR! #aws-amplify/amplify-category-api#"1.1.10" from #aws-amplify/cli#7.6.8
npm ERR! node_modules/#aws-amplify/cli
npm ERR! #aws-amplify/cli#"*" from the root project
npm ERR! #aws-amplify/amplify-category-api#"1.1.10" from amplify-container-hosting#2.4.10
npm ERR! node_modules/#aws-amplify/cli/node_modules/amplify-container-hosting
npm ERR! amplify-container-hosting#"2.4.10" from #aws-amplify/cli#7.6.8
npm ERR! node_modules/#aws-amplify/cli
npm ERR! #aws-amplify/cli#"*" from the root project
npm ERR! graphql#"^14.5.8" from #aws-amplify/graphql-auth-transformer#0.5.7
npm ERR! node_modules/#aws-amplify/cli/node_modules/#aws-amplify/graphql-auth-transformer
npm ERR! #aws-amplify/graphql-auth-transformer#"0.5.7" from #aws-amplify/cli#7.6.8
npm ERR! node_modules/#aws-amplify/cli
npm ERR! #aws-amplify/cli#"*" from the root project
npm ERR! #aws-amplify/graphql-auth-transformer#"0.5.7" from amplify-provider-awscloudformation#5.8.7
npm ERR! node_modules/#aws-amplify/cli/node_modules/amplify-provider-awscloudformation
npm ERR! amplify-provider-awscloudformation#"5.8.7" from #aws-amplify/cli#7.6.8
npm ERR! node_modules/#aws-amplify/cli
npm ERR! #aws-amplify/cli#"*" from the root project
npm ERR! 2 more (#aws-amplify/amplify-category-api, amplify-util-mock)
npm ERR! 1 more (#aws-amplify/graphql-relational-transformer)
npm ERR! 88 more (amplify-app, amplify-codegen, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer graphql#"^15.0.0" from relay-compiler#12.0.0
npm ERR! node_modules/#aws-amplify/cli/node_modules/amplify-codegen-appsync-model-plugin/node_modules/#graphql-codegen/visitor-plugin-common/node_modules/relay-compiler
npm ERR! relay-compiler#"12.0.0" from #graphql-tools/relay-operation-optimizer#6.4.1
npm ERR! node_modules/#aws-amplify/cli/node_modules/amplify-codegen-appsync-model-plugin/node_modules/#graphql-codegen/visitor-plugin-common/node_modules/#graphql-tools/relay-operation-optimizer
npm ERR! #graphql-tools/relay-operation-optimizer#"^6.3.7" from #graphql-codegen/visitor-plugin-common#2.5.2
npm ERR! node_modules/#aws-amplify/cli/node_modules/amplify-codegen-appsync-model-plugin/node_modules/#graphql-codegen/visitor-plugin-common
npm ERR! #graphql-codegen/visitor-plugin-common#"^2.5.1" from amplify-codegen-appsync-model-plugin#1.24.4
npm ERR! node_modules/#aws-amplify/cli/node_modules/amplify-codegen-appsync-model-plugin
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
run npm install -g npm#latest
and after that try installing amplify-cli again.

Installing expo-cli: Could not resolve dependency:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: type-fest#0.5.2
npm ERR! node_modules/expo-cli/node_modules/type-fest
npm ERR! type-fest#"^0.5.2" from boxen#4.1.0
npm ERR! node_modules/expo-cli/node_modules/boxen
npm ERR! boxen#"4.1.0" from expo-cli#4.4.7
npm ERR! node_modules/expo-cli
npm ERR! expo-cli#"*" from the root project
npm ERR! boxen#"4.1.0" from xdl#59.0.37
npm ERR! node_modules/expo-cli/node_modules/xdl
npm ERR! xdl#"59.0.37" from expo-cli#4.4.7
npm ERR! node_modules/expo-cli
npm ERR! expo-cli#"*" from the root project
npm ERR! 1 more (#expo/dev-tools)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional type-fest#"^0.13.1" from #pmmmwh/react-refresh-webpack-plugin#0.3.3
npm ERR! node_modules/expo-cli/node_modules/#pmmmwh/react-refresh-webpack-plugin
npm ERR! #pmmmwh/react-refresh-webpack-plugin#"^0.3.3" from #expo/webpack-config#0.12.71
npm ERR! node_modules/expo-cli/node_modules/#expo/webpack-config
npm ERR! #expo/webpack-config#"0.12.71" from xdl#59.0.37
npm ERR! node_modules/expo-cli/node_modules/xdl
npm ERR! xdl#"59.0.37" from expo-cli#4.4.7
npm ERR! node_modules/expo-cli
npm ERR! 1 more (#expo/dev-tools)
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
I tried using --force but it didn't work. I also tried using --legacy-peer-deps and that made it install but when I type expo init myapp it says:
bash: expo: command not found
What is the problem over here?
I had the same issue, but this command worked for me:
npm install --global expo-cli --legacy-peer-deps

Resources