I cant install node modules in react native ,and I get a error message, how can i fix this? - react-native

After installing some packages I stumbeled against this error, and I dont know how to fix this:
I hope someone knows how to get this cleaned up, I dont care if I have to install all the packages again.
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command C:\Program Files\nodejs\node.exe C:\Users\muziek\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js install --force --cache=C:\Users\muziek\AppData\Local\npm-cache --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! > #expo/vector-icons#13.0.0 prepare
npm ERR! > expo-module prepare && npm run generate-lazy && npm run copy-vendor
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN deprecated set-value#0.4.3: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm ERR! npm WARN deprecated mixin-deep#1.3.1: Critical bug fixed in v2.0.1, please upgrade to the latest version.
npm ERR! npm WARN deprecated set-value#2.0.0: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm ERR! npm WARN deprecated kleur#2.0.2: Please upgrade to kleur#3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).
npm ERR! npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm ERR! npm WARN deprecated har-validator#5.1.3: this library is no longer supported
npm ERR! npm WARN deprecated request-promise-native#1.0.7: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm ERR! npm WARN deprecated chokidar#2.1.2: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm ERR! npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! npm WARN deprecated w3c-hr-time#1.0.1: Use your platform's native performance.now() and performance.timeOrigin.
npm ERR! npm WARN deprecated source-map-url#0.4.0: See https://github.com/lydell/source-map-url#deprecated
npm ERR! npm WARN deprecated left-pad#1.3.0: use String.prototype.padStart()
npm ERR! npm WARN deprecated debug#4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm ERR! npm WARN deprecated debug#3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm ERR! npm WARN deprecated sane#2.5.2: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm ERR! npm WARN deprecated request#2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! npm WARN deprecated source-map-resolve#0.5.2: See https://github.com/lydell/source-map-resolve#deprecated
npm ERR! npm WARN deprecated uuid#3.3.2: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm ERR! npm WARN deprecated mkdirp#0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm ERR! npm WARN deprecated core-js#2.6.5: core-js#<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! C:\Users\muziek\AppData\Local\npm-cache\_cacache\tmp\git-clone9p2w60\node_modules\expo-module-scripts\bin\expo-module-prepare:3
npm ERR! set -eo pipefail
npm ERR! ^^^^^^^^
npm ERR!
npm ERR! SyntaxError: Unexpected identifier
npm ERR! at Object.compileFunction (node:vm:352:18)
npm ERR! at wrapSafe (node:internal/modules/cjs/loader:1031:15)
npm ERR! at Module._compile (node:internal/modules/cjs/loader:1065:27)
npm ERR! at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
npm ERR! at Module.load (node:internal/modules/cjs/loader:981:32)
npm ERR! at Function.Module._load (node:internal/modules/cjs/loader:822:12)
npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
npm ERR! at node:internal/main/run_main_module:17:47
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path C:\Users\muziek\AppData\Local\npm-cache\_cacache\tmp\git-clone9p2w60
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c expo-module prepare && npm run generate-lazy && npm run copy-vendor
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR! C:\Users\muziek\AppData\Local\npm-cache\_logs\2023-01-09T08_48_36_983Z-debug-0.log
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\muziek\AppData\Local\npm-cache\_logs\2023-01-09T08_48_13_969Z-debug-0.log

Try deleting the node_modules directory and running npm install again. This will force npm to reinstall all of the dependencies, which might fix the problem.
If that doesn't work, you might want to try deleting the package-lock.json file and running npm install again.
If none of these steps help, you can try running npm install --force. However, using the --force flag can also cause problems if it causes npm to overwrite or delete files that are needed for your project to work correctly. It's generally a good idea to use the --force flag only as a last resort, after other methods of fixing the problem have been tried.

Try this,
run npm cache clean --force
Delete node_modules like $ rm -rf node_modules also delete package-lock.json
Install fresh packages npm install
Start the application npm start
Let us know your feedback.
Thanks

Related

npm install -g #vue/cli get error VUE CLI INSTALL ERROR npm star and vue serve

npm start
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/daniel/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/daniel/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/daniel/.npm/_logs/2022-11-11T00_09_58_091Z-debug-0.log
npm install -g #vue/cli
npm WARN deprecated source-map-url#0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve#0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated subscriptions-transport-ws#0.11.0: The subscriptions-transport-ws package is no longer maintained. We recommend you use graphql-ws instead. For help migrating Apollo software to graphql-ws, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws For general help using graphql-ws, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md
changed 847 packages, and audited 848 packages in 40s
64 packages are looking for funding
run npm fund for details
4 vulnerabilities (2 moderate, 2 high)
To address all issues (including breaking changes), run:
npm audit fix --force
Run npm audit for details.
Trying to install vue/cli and trying to run vue will do, but the errors described

'npm install' gives warnings at first but a second execution gives errors

Im upgrading my project to react v18. Im using multiple packages relying on react v17.
My process for doing the upgrade is to update react to v18 and run npm install.
It gives peer dependency errors. I go and fix one by one.
I run npm install after updating a package version to one that supports react v18.
But something "weird" is happening. First time I run npm install it throws me warning:
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-popper#2.2.5
npm WARN Found: react#18.2.0
npm WARN node_modules/react
npm WARN peer react#"0.14.x || ^15.0.0 || ^16.0.0 || ^17.0.0" from react-popper#1.3.11
npm WARN node_modules/#blueprintjs/core/node_modules/react-popper
npm WARN react-popper#"^1.3.7" from #blueprintjs/core#4.6.0
npm WARN node_modules/#blueprintjs/core
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react#"^16.8.0 || ^17" from react-popper#2.2.5
npm WARN node_modules/#blueprintjs/popover2/node_modules/react-popper
npm WARN react-popper#"^2.2.4" from #blueprintjs/popover2#1.4.2
npm WARN node_modules/#blueprintjs/popover2
Ok, I got warnings but installation is not broken. Now, if I run again npm install without modifying anything it will throw errors:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #storybook/addon-essentials#6.4.22
npm ERR! Found: react#18.2.0
npm ERR! node_modules/react
npm ERR! react#"18.2.0" from the root project
npm ERR! peer react#"^16.8 || 17 || 18" from #blueprintjs/core#4.6.0
npm ERR! node_modules/#blueprintjs/core
npm ERR! #blueprintjs/core#"^4.6.0" from the root project
npm ERR! #blueprintjs/core#"^4.6.0" from #blueprintjs/datetime#4.3.2
npm ERR! node_modules/#blueprintjs/datetime
npm ERR! #blueprintjs/datetime#"^4.3.2" from the root project
npm ERR! 1 more (#blueprintjs/popover2)
npm ERR! 39 more (#blueprintjs/datetime, #blueprintjs/popover2, ...)
npm ERR!
Why it did not throw these errors with the first npm install ?
It looks weird to me that at first it only throws warnings but executing npm install a second time it does actually throw. I could clearly see issues into committing package-lock.json changes where there are only warnings to find later that running npm install throws errors.
Is this execution normal ?
Not sure if this question is for stack overflow or some other channel. Please, let me know if it does not belong to here.

issues with installing react native, npm install -g expo-cli gives warnings

I'm trying to install Expo CLI to set up the development environment for React Native but I keep getting this warning when I enter "npm install -g expo-cli" into my terminal:
npm WARN EBADENGINE required: { node: '>=12 <=16' },
npm WARN EBADENGINE current: { node: 'v18.2.0', npm: '8.9.0' }
Previously, trying to install Expo CLI with npm would throw errors like
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/expo-cli
npm ERR! dest /usr/local/lib/node_modules/.expo-cli-dKBr48UN
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/expo-cli' -> '/usr/local/lib/node_modules/.expo-cli-dKBr48UN'
npm ERR! [Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/expo-cli' -> '/usr/local/lib/node_modules/.expo-cli-dKBr48UN'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/usr/local/lib/node_modules/expo-cli',
npm ERR! dest: '/usr/local/lib/node_modules/.expo-cli-dKBr48UN'
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.
Then I tried the NVM solution in this post which asked me to uninstall node and then install NVM so that doing things like writing in my npm directory wouldn't ask for permission, but now I'm unsure what to do.
edit:
I followed this website to change my node version to v14.19.3 but now there are these warnings:
npm WARN deprecated subscriptions-transport-ws#0.9.8: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md
npm WARN deprecated graphql-tools#3.0.0: This package has been deprecated and now it only exports makeExecutableSchema.\nAnd it will no longer receive updates.\nWe recommend you to migrate to scoped packages such as #graphql-tools/schema, #graphql-tools/utils and etc.\nCheck out https://www.graphql-tools.com to learn what package you should use instead
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated svgo#1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated source-map-resolve#0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated source-map-url#0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated chokidar#2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
/Users/zoeylee/.nvm/versions/node/v14.19.3/bin/expo -> /Users/zoeylee/.nvm/versions/node/v14.19.3/lib/node_modules/expo-cli/bin/expo.js
/Users/zoeylee/.nvm/versions/node/v14.19.3/bin/expo-cli -> /Users/zoeylee/.nvm/versions/node/v14.19.3/lib/node_modules/expo-cli/bin/expo.js
npm WARN ajv-keywords#3.5.2 requires a peer of ajv#^6.9.1 but none is installed. You must install peer dependencies yourself.
I'm a new user and programmer so any advice/help is appreciated, thanks!
You are using 18.2.0, but the message says it requires >=12 <=16 (greater than 12 and less than 16. Not 18.2.0 or greater.
If it's your package.json with the engines field causing this issue, change it to say 12.0.0 or greater:
"engines": {
"node": ">=12.0.0"
},

Can't install parcel using [npm i --save-dev parcel]

I'm trying to install parcel and used the command given in the official documentation
npm install --save-dev parcel
It outputs some warnings saying it's deprecated and errors as follows.
npm WARN deprecated request-promise-native#1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 1
npm ERR! path D:\Courses\Front-End\Workspace\Trainings & Challenges\Jonas Schmedtman\17-Modern JS\node_modules\lmdb-store
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp-build
npm ERR! The system cannot find the path specified.
npm ERR! internal/modules/cjs/loader.js:905
npm ERR! throw err;
npm ERR! ^
npm ERR!
npm ERR! Error: Cannot find module 'D:\Courses\Front-End\Workspace\node-gyp-build\bin.js'
npm ERR! at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
npm ERR! at Function.Module._load (internal/modules/cjs/loader.js:746:27)
npm ERR! at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
npm ERR! at internal/main/run_main_module.js:17:47 {
npm ERR! code: 'MODULE_NOT_FOUND',
npm ERR! requireStack: []
npm ERR! }
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Muhammad\AppData\Local\npm-cache\_logs\2021-12-22T14_51_13_204Z-debug-0.log
Here's a screenshot:
Eventually parcel isn't installed. any help please.
I'm using VS code on Win 11.
I tried to install parcel again today with some patience and it worked.
It turned out that my address has a folder with an ampersand & in it that causes the problem even though that the folder name contains a space. Wierd thing that other packages was installed successfully without having any problem.
Old Address:
D:\Courses\Front-End\Workspace\Trainings & Challenges\Jonas Schmedtman\17-Modern JS
New Address:
D:\Courses\Front-End\Workspace\Trainings Challenges\Jonas Schmedtman\17-Modern JS

"npm start" wont work after "create-react-app"

I have tried everything. Looking at "PATH" variable in windows 10
-reinstalled node multiple times and multiple versions
-removed all node files and npm files from the program folder and the AppData and user folder.
-I finally got the react app to work but then when every I do "npm start" it gives me the errors.
-I have deleted node modules and package-lock.json file as well and still no solution.
PS C:\Users\Imran\Desktop\zertomastery\19_react\maryam1> npm start
> maryam1#0.1.0 start
> react-scripts start
npm ERR! code ENOENT
npm ERR! syscall spawn bash
npm ERR! path C:\Users\Imran\Desktop\zertomastery\19_react\maryam1
npm ERR! errno -4058
npm ERR! enoent spawn bash ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Imran\AppData\Local\npm-cache\_logs\2021-07-18T18_17_31_571Z-debug.log-debug.log
PS C:\Users\Imran\Desktop\zertomastery\19_react\maryam1>
I have deleted the node_modules folder and the package-lock.json and done npm install
-results of npm install after deleting node_modules and package.json.
PS C:\Users\Imran\Desktop\zertomastery\19_react\maryam1> npm start > npm install
npm WARN deprecated #hapi/bourne#1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/topo#3.1.6: This version has
been deprecated and is no longer supported or maintained act\maryam1
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.co find a file.om/lydell/resolve-url#deprecated
npm WARN deprecated querystring#0.2.1: The querystring
API is considered Legacy. new code should use the URLSearchParams API instead. 18_17_31_571Z-debug.log
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will bregs\2021-07-18Tak on node v14+. Upgrade to chokidar 3 with 15x less dependencies. >
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated querystring#0.2.0: The querystring
API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated sane#4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated #hapi/address#2.1.4: Moved to 'npm
install #sideway/address'
npm WARN deprecated babel-eslint#10.1.0: babel-eslint is now #babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated rollup-plugin-babel#4.4.0: This package has been deprecated and is no longer maintained. Please use #rollup/plugin-babel.
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random()
in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random()
in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated #hapi/hoek#8.5.1: This version has
been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/joi#15.1.1: Switch to 'npm install joi'
npm WARN deprecated core-js#2.6.12: core-js#<3.3 is no
longer maintained and not recommended for usage due to
the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a
slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of
core-js.
npm ERR! code ENOENT
npm ERR! syscall spawn bash
npm ERR! path C:\Users\Imran\Desktop\zertomastery\19_react\maryam1\node_modules\core-js
npm ERR! errno -4058
npm ERR! enoent spawn bash ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Imran\AppData\Local\npm-cache\_logs\2021-07-18T18_22_24_801Z-debug.log
PS C:\Users\Imran\Desktop\zertomastery\19_react\maryam1
after doing allot of commands and things I am not getting this when do "npm start" I switched to bash
Imran#DESKTOP-3331IKE MINGW64 ~/Desktop/zertomastery/19_react/maryam1 (main)
$ npm start
> maryam1#0.1.0 start
> react-scripts start
node:internal/modules/cjs/loader:355
throw err;
^
Error: Cannot find module 'C:\Users\Imran\Desktop\zertomastery\19_react\maryam1\node_modules\loader-runner\lib\LoaderRunner.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:347:19)
at Function.Module._findPath (node:internal/modules/cjs/loader:560:18)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:913:27)
at Function.Module._load (node:internal/modules/cjs/loader:772:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:93:18)
at Object.<anonymous> (C:\Users\Imran\Desktop\zertomastery\19_react\maryam1\node_modules\webpack\lib\NormalModule.js:16:36)
at Module._compile (node:internal/modules/cjs/loader:1095:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
at Module.load (node:internal/modules/cjs/loader:975:32) {
code: 'MODULE_NOT_FOUND',
path: 'C:\\Users\\Imran\\Desktop\\zertomastery\\19_react\\maryam1\\node_modules\\loader-runner\\package.json',
requestPath: 'loader-runner'
}
Imran#DESKTOP-3331IKE MINGW64 ~/Desktop/zertomastery/19_react/maryam1 (main)
$
Try This,
npm cache clean
npm install
npm start