Here's what I get after I try to install/uninstall packages:
(base) vivekrk#Viveks-MacBook-Air PUPA % npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-navigation-drawer#1.4.0
npm ERR! Found: react-native-screens#3.18.0
npm ERR! node_modules/react-native-screens
npm ERR! react-native-screens#"^3.18.0" from the root project
npm ERR! peer react-native-screens#">= 3.0.0" from #react-navigation/native-stack#6.9.0
npm ERR! node_modules/#react-navigation/native-stack
npm ERR! #react-navigation/native-stack#"^6.9.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-screens#"^1.0.0 || ^1.0.0-alpha" from react-navigation-drawer#1.4.0
npm ERR! node_modules/react-navigation-drawer
npm ERR! react-navigation-drawer#"^1.4.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react-native-screens#1.0.0-alpha.23
npm ERR! node_modules/react-native-screens
npm ERR! peer react-native-screens#"^1.0.0 || ^1.0.0-alpha" from react-navigation-drawer#1.4.0
npm ERR! node_modules/react-navigation-drawer
npm ERR! react-navigation-drawer#"^1.4.0" 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/vivekrk/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/vivekrk/.npm/_logs/2022-10-10T04_17_37_997Z-debug-0.log
Also I'm unable to run npx react-native start
This is happening after I installed few npm packages and were not useful so I uninstalled. But after that I couldn't install new packages.
Please resolve my problem!!
Maybe you have dependency conflict, so you can try to run it with --force
Full command:
npm install --force
Or you can try to downgrade your nodejs version.
Related
PS E:\aub\stackoverflow-clone-mern\frontend> npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-html-parser#2.0.2
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.8.0 || ^17.0.0" from #material-ui/core#4.12.3
npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"^4.12.3" from the root project
npm ERR! peer #material-ui/core#"^4.0.0" from #material-ui/icons#4.11.2
npm ERR! node_modules/#material-ui/icons
npm ERR! #material-ui/icons#"^4.11.2" from the root project
npm ERR! 20 more (#material-ui/icons, #material-ui/styles, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^0.14.0 || ^15.0.0 || ^16.0.0-0" from react-html-parser#2.0.2
npm ERR! node_modules/react-html-parser
npm ERR! react-html-parser#"^2.0.2" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#16.14.0
npm ERR! node_modules/react
npm ERR! peer react#"^0.14.0 || ^15.0.0 || ^16.0.0-0" from react-html-parser#2.0.2
npm ERR! node_modules/react-html-parser
npm ERR! react-html-parser#"^2.0.2" 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! node_modules/react
npm ERR! peer react#"^0.14.0 || ^15.0.0 || ^16.0.0-0" from react-html-parser#2.0.2
npm ERR! node_modules/react-html-parser
npm ERR! react-html-parser#"^2.0.2" 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\Ayoub\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\Ayoub\AppData\Local\npm-cache_logs\2023-02-03T22_54_33_973Z-debug-0.log
package.json
"dependencies": {
"axios": "^0.21.1",
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"dotenv": "^10.0.0",
"express": "^4.17.1",
"mongoose": "^6.0.2",
"nodemon": "^2.0.12"
}
I want to create a new react-native app using react-native cli, so I used the command npx react-native init newApp according to the documentation at https://reactnative.dev/docs/environment-setup. While executing this I am getting npm error logs as follows:
PS D:\Android development> npx react-native init newApp
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
Need to install the following packages:
react-native#0.70.3
Ok to proceed? (y) y
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: undefined#undefined
npm ERR! Found: react-native#0.68.1
npm ERR! node_modules/react-native
npm ERR! peer react-native#"*" from #react-native-community/cli#7.0.3
npm ERR! node_modules/#react-native-community/cli
npm ERR! #react-native-community/cli#"^7.0.3" from react-native#0.68.1
npm ERR! react-native#"0.70.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! react-native#"0.70.3" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#18.1.0
npm ERR! node_modules/react
npm ERR! peer react#"18.1.0" from react-native#0.70.3
npm ERR! node_modules/react-native
npm ERR! react-native#"0.70.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\abhad\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\abhad\AppData\Local\npm-cache\_logs\2022-10-13T07_58_54_900Z-debug-0.log
Can anyone solve this? Please suggest a solution.
I just fixed this issue. Looks like its a problem with npm.
I just ran npm config set legacy-peer-deps true before running npx react-native init newApp (according to https://github.com/facebook/react-native/issues/34051) and this fixed all!
I tried to install quick.db with npm:
$ npm i quick.db better-sqlite3
And it's giving me an error:
npm ERR! code EPERM
npm ERR! syscall symlink
npm ERR! path ../prebuild-install/bin.js
npm ERR! dest /storage/emulated/0/bot/node_modules/.bin/prebuild-install
npm ERR! errno -1
npm ERR! Error: EPERM: operation not permitted, symlink '../prebuild-install/bin.js' -> '/storage/emulated/0/bot/node_modules/.bin/prebuild-install'
npm ERR! [Error: EPERM: operation not permitted, symlink '../prebuild-install/bin.js' -> '/storage/emulated/0/bot/node_modules/.bin/prebuild-install'] {
npm ERR! errno: -1,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'symlink',
npm ERR! path: '../prebuild-install/bin.js',
npm ERR! dest: '/storage/emulated/0/bot/node_modules/.bin/prebuild-install'
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! /data/data/com.termux/files/home/.npm/_logs/2022-07-20T09_05_11_700Z-debug-0.log
So I think this is problem with installing a better-sqlite3, beacuse I don't have problems with installing only quick.db:
npm i quick.db
npm WARN deprecated nomnom#1.8.1: Package no longer supported. Contact support#npmjs.com for more info.
npm WARN deprecated #mapbox/geojsonhint#2.0.1: Please make plans to check GeoJSON in some other way
npm ERR! code EPERM
npm ERR! syscall symlink
npm ERR! path ../#mapbox/geojsonhint/bin/geojsonhint
npm ERR! dest /storage/emulated/0/Coding/noda/node_modules/.bin/geojsonhint
npm ERR! errno -1
npm ERR! Error: EPERM: operation not permitted, symlink '../#mapbox/geojsonhint/bin/geojsonhint' -> '/storage/emulated/0/Coding/noda/node_modules/.bin/geojsonhint'
npm ERR! [Error: EPERM: operation not permitted, symlink '../#mapbox/geojsonhint/bin/geojsonhint' -> '/storage/emulated/0/Coding/noda/node_modules/.bin/geojsonhint'] {
npm ERR! errno: -1,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'symlink',
npm ERR! path: '../#mapbox/geojsonhint/bin/geojsonhint',
npm ERR! dest: '/storage/emulated/0/Coding/noda/node_modules/.bin/geojsonhint'
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! /data/data/com.termux/files/home/.npm/_logs/2022-04-25T18_23_32_395Z-debug-0.log
Install it with --no-bin-links.
npm install -g ionic
npm ERR! Error: EACCES, mkdir '/usr/lib/node_modules/ionic'
npm ERR! { [Error: EACCES, mkdir '/usr/lib/node_modules/ionic']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/lib/node_modules/ionic',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/lib/node_modules/ionic',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR! '/usr/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53',
npm ERR! 'Object.oncomplete (fs.js:107:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.2.0-72-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "ionic"
npm ERR! cwd /home/livemen
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! path /usr/lib/node_modules/ionic
npm ERR! fstream_path /usr/lib/node_modules/ionic
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/lib/node_modules/ionic'
npm ERR! fstream_stack /usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: EACCES, open 'npm-debug.log'
npm ERR! { [Error: EACCES, open 'npm-debug.log'] errno: 3, code: 'EACCES', path: 'npm-debug.log' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.2.0-72-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "ionic"
npm ERR! cwd /home/livemen
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! path npm-debug.log
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open 'npm-debug.log'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/livemen/npm-debug.log
npm ERR! not ok code 0
Like the error says, try running this again as administrator, i.e. try sudo npm install -g ionic.
You run npm with user permissions (which is correct way) but it cannot create subdirectories inside /usr/lib. A recommended way to fix it is to change the ownership
sudo chown -R $USER /usr/lib
provided you are the only user who should install global node packages on your machine.
Resist the temptation to sudo npm :-)
See here for more details.