ENOENT (error -4058) during create-react-app - javascript

when i type npm command create-react-app my-app i have error like this :
npm ERR! code ENOENT
npm ERR! syscall spawn C:\Windows\System32;
npm ERR! path C:\Users\Administrator\Documents\th-wedding\template
npm ERR! errno -4058
npm ERR! enoent spawn C:\Windows\System32; 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\Administrator\AppData\Local\npm-cache\_logs\2023-02-02T04_41_46_601Z-debug-0.log
I've tried every way, from setting up the env, and reinstalling with a different version, but still the error

ENOENT means There is no directory exists with this name
Now You need to check several points:
Check the version of node js & npm (check version installed is proper)
remove cache (npm cache clean --force or npm cache clean)
verify removed cache (npm cache verify --force or npm cache verify)
check the installed version or install the new version or re-install again of react react-dom react-scripts using (npm install --save react create-react-app)
then create a new app using npx create-react-app app-name
Of If your project is already created then install necessary dependencies using (npm install)

Related

npx create-react-app show error when installing

npx create-react-app shoing eror whent installing, please help me how to solve this
problem. my nodejs version is v16.14.2 and npm version is 8.5.0
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
added 1354 packages in 1m
171 packages are looking for funding
run `npm fund` for details
Initialized a git repository.
Installing template dependencies using npm...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: instagram-clone#0.1.0
npm ERR! Found: react#18.0.0
npm ERR! node_modules/react
npm ERR! react#"^18.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"<18.0.0" from #testing-library/react#12.1.5
npm ERR! node_modules/#testing-library/react
npm ERR! #testing-library/react#"^12.0.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 /home/psn/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/psn/.npm/_logs/2022-04-12T07_12_21_032Z-debug-0.log
`npm install --no-audit --save #testing-library/jest-dom#^5.14.1 #testing-
library/react#^12.0.0 #testing-library/user-event#^13.2.1 web-vitals#^2.1.0` failed
Sounds like you are running npx create-react-app command in a project that already includes react. Try running npm install instead.
If that does not work try to remove your node_modules folder and run npm install again.
You can try the following:
Delete both node_modules and package-lock.json
Run npm i web-vitals --save-dev
Run npm install

I keep getting a installation error when I try to install any NPM package

Lately, I found out that with every package I want to install I keep getting a error. Its always the same.
What I've tried:
Updating node/NPM
Repairing node/NPM
Fixing git bash in path variable.
Deleting package-lock.json and running npm install
Deleting node_modules and package-lock.json and running npm install.
Clearing npm cache
Manually creating the folder it says it can't find. However, this doesn't change anything.
Manually adding the npm package to package-JSON. running npm install but again. results in an error.
Packages installed fine at first. This has been like this for a week or 2.
short error:
npm ERR! code ENOENT
npm ERR! syscall spawn bash
npm ERR! path C:\Users\Timsl\Documents\FarCryDiscordBot\node_modules\better-sqlite3
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
full log:
https://pastebin.com/1B4yLCLK

How to fix npm ERR! Cannot find module './src/table' when running npx create-react-app

On Windows 10, I am getting this error: npm ERR! Cannot find module './src/table' when trying to start a new project with
npx create-react-app my-app. I searched around but really couldn't find anything about this module './src/table'
Here is the log:
$ npx create-react-app my-app
Creating a new React app in D:\reandomDirectory.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module './src/table'
npm ERR! Require stack:
npm ERR! - C:\Users\MyPC\AppData\Roaming\nvm\v12.16.1\node_modules\npm\node_modules\cli-table3\index.js
npm ERR! - C:\Users\MyPC\AppData\Roaming\nvm\v12.16.1\node_modules\npm\node_modules\npm-audit-report\reporters\detail.js
npm ERR! - C:\Users\MyPC\AppData\Roaming\nvm\v12.16.1\node_modules\npm\node_modules\npm-audit-report\index.js
npm ERR! - C:\Users\MyPC\AppData\Roaming\nvm\v12.16.1\node_modules\npm\lib\install\audit.js
npm ERR! - C:\Users\MyPC\AppData\Roaming\nvm\v12.16.1\node_modules\npm\lib\install.js
npm ERR! - C:\Users\MyPC\AppData\Roaming\nvm\v12.16.1\node_modules\npm\lib\npm.js
npm ERR! - C:\Users\MyPC\AppData\Roaming\nvm\v12.16.1\node_modules\npm\bin\npm-cli.js
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\MyPC\AppData\Roaming\npm-cache\_logs\2021-05-24T01_01_52_667Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting my-app/ from D:\reandomDirectory
Done.
I have version 3.4.1 globally installed and even if I try to uninstall it I get the same error.
Also, the directory where I am trying to start the project is completely empty.
Any idea of how I could fix this?

Angular CLI Installetion Error for Ubuntu 20.04

sudo npm install -global #angular/cli
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm ERR! code EEXIST
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/#angular/cli/bin/ng
npm ERR! dest /usr/bin/ng
npm ERR! errno -17
npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/#angular/cli/bin/ng' -> '/usr/bin/ng'
npm ERR! File exists: /usr/bin/ng
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-10-03T08_55_44_693Z-debug.log
I also use Ubuntu 20.04 and I just had the same problem as you.
Here I just updated the npm package (via synaptic).
After this, sudo npm i -g #angular/cli worked ok.
This point solved my problem, maybe that can help you too.
I had a similar problem on Ubuntu 20.04, after I install nodejs (in my case 14.17 stable) and try install Angular.
I went to the directory /usr/bin and deleted the ng file,
after sudo npm i -g #angular/cli.
So ng --version to see if installed ok.
I hope help yo, bye.

Getting error while installing udev module in node js

I'm runnig command :
npm install udev
And I'm getting this error:
npm WARN enoent ENOENT: no such file or directory, open '/home/mitesh/package.json'
npm WARN mitesh No description
npm WARN mitesh No repository field.
npm WARN mitesh No README data
npm WARN mitesh No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! udev#0.6.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the udev#0.6.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/mitesh/.npm/_logs/2020-03-16T11_44_35_032Z-debug.log
Looks like you do not have a package.json in your project or it is probably not rightly placed. Here is what you can do;
Browse to your project directory and run this command;
npm init
This should create a package.json file in your project directory
Then run,
npm install udev --save
--save will ensure your module is saved as a dependency in your package.json file.
you could just try to run the last command without the --save but in some cases it helps
Here is a link to further assist: npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Nuwanst\package.json'
Try this let me know if it helps.

Categories