I can't create react app by using npx create-react-app it takes long time and shows this type of error - create-react-app

Creating a new React app in G:\My Drive\projects\portfolio\my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code ENOTDIR
npm ERR! syscall mkdir
npm ERR! path G:\My Drive\projects\portfolio\my-
app\node_modules\webpack\node_modules
npm ERR! errno -4052
npm ERR! ENOTDIR: not a directory, mkdir 'G:\My
Drive\projects\portfolio\my-app\node_modules\webpack\node_modules'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Local\npm-cache\_logs\2023-01-
20T08_59_44_240Z-debug-0.log
Aborting installation.
npm install --no-audit --save --save-exact --loglevel error react react-
dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting my-app/ from G:\My Drive\projects\portfolio
Done.
I'm a front-end Developer. I uninstall the nodejs couple of times and then try these commands: "npm cache clean --force", npm uninstall -g create-react-app then reinstall create-react-app but it doesn't work, also updated the latest version of nodejs, use yarn also but couldn't solve the problem, delete the node_modules but it couldn't work, if anyone here pls help me!

Related

Got errs with puppeteer and node-sass running npm i

I have a double problem.
The work environment is in Vue and Nuxt, with a mac M1 pro.
Until last week, I had no problems, everything was running perfect. They changed my mac and the world stopped running.
I download 2 repos, but when running npm i, one explodes with puppeteer and the other with node-sass.
npm ERR! code ELIFECYCLE npm ERR! error 1 npm ERR! puppeteer#8.0.0 install:nodeinstall.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the puppeteer#8.0.0 install script.
npm ERR! code ELIFECYCLE npm ERR! error 1 npm ERR! node-sass#4.14.1 postinstall: node scripts/build.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-sass#4.14.1 postinstall script.
I am using the correct version of Node.
I tried deleting the package-lock.json and the node_modules, clearing the npm cache, and running npm i again, and no, it breaks.
I tried installing those specific packages outside of npm i, and I get the same error.
I tried creating a .npmrc file with
registry=https://registry.npmjs.org always-auth=true //registry.npmjs.org/: "token"
I am using the same package.json and the same repos as my peers. They also have mac M1 and have no problem.
On Github we have the same permissions.
Any idea what is happening?
Thank you very much in advance \o/
You can use sass instead of node-sass. This is because node-sass has been deprecated.
npm uninstall node-sass
npm install sass
Works all the same, no need to make any other changes

npm ERR! code ENOLOCAL while running npm install

I am facing the error below, I tried clear the cache and install npm latest but all are no use to me, may I know is there any way to resolve it?
> npm install
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules\tui-editor\squire-rte#github:seonim-ryu\Squire#fd40b4e3020845825701e9689f190bab3f4775d4" as it does not contain a package.json file.
you should try to delete node modules folder repeatedly and reinstall packages by npm install command
npm cache clean try this command after deleted node modules

npm ERR! code ENOTEMPTY npm ERR! syscall rename

when I try to initialize a react-native project I am getting this error. Anyone know how to resolve this please help
i am using mac
Need to install the following packages:
react-native
Ok to proceed? (y) y
npm ERR! code ENOTEMPTY
npm ERR! syscall rename
npm ERR! path /Users/codelanticdeveloper/.npm/_npx/7930a8670f922cdb/node_modules/react-native
npm ERR! dest /Users/codelanticdeveloper/.npm/_npx/7930a8670f922cdb/node_modules/.react-native-QIQKGFeg
npm ERR! errno -66
npm ERR! ENOTEMPTY: directory not empty, rename '/Users/codelanticdeveloper/.npm/_npx/7930a8670f922cdb/node_modules/react-native' -> '/Users/codelanticdeveloper/.npm/_npx/7930a8670f922cdb/node_modules/.react-native-QIQKGFeg'
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/codelanticdeveloper/.npm/_logs/2022-02-16T15_54_46_715Z-debug-0.log
where it says...
directory not empty, rename '/Users/codelanticdeveloper/.npm/_npx/7930a8670f922cdb/node_modules/react-native' -> '/Users/codelanticdeveloper/.npm/_npx/7930a8670f922cdb/node_modules/.react-native-QIQKGFeg'
delete the file after the arrow and try again
rm -rf '/Users/codelanticdeveloper/.npm/_npx/7930a8670f922cdb/node_modules/.react-native-QIQKGFeg'
Try deleting all the files in the node modules that end with a similar names, like '*-QIQKGFeg'
I did it manually and it worked for me
I also had this problem and fixed it by:
Deleting the problematic Expo files here per the instructions here I'm trying to reinstall expo-cli package globally with the command sudo npm install --g expo-cli note that I try --force
In the terminal, running nvm install 16.14.0 (this will download the correct Node.js LTS release that is required by Expo)
In the terminal, running brew install watchman (this is required by Expo)
In the terminal, running npm install --global expo-cli (globally downloading Expo again)
In the terminal, running expo init my-app to finally create the new app successfully!

Whenever I run npm install in my terminal, I get "cb() never called"

npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\JOVANNE DELA ROSA\AppData\Roaming\npm-cache\_logs\2021-07-16T20_58_48_839Z-debug.log
When we install a node packages from package.json file and package-lock.json file is corrupted due to some reasons like node.js version is updated to the latest, we will see an error like this in our terminal.
To fix this error, first delete the package-lock.json file and run the following command.
npm cache clean --force
Now, try to install your packages using the npm install command.

Unable to update or execute the 'expo' command in command prompt

For the first time i tried to install the expo-cli on my project directory it worked. I can use expo init to make my first react native app in my command prompt, and run the app with expo start. But now when i have some new project to make with the 'expo' command like expo init or expo start or something else, it didn't work anymore. When i tried to type and enter the expo command, its always be
'expo' is not recognized as an internal or external command, operable program or batch file.
And now when i tried to update the expo-cli with npm install -g expo-cli a warning of error appeared.
npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path C:\Users\ACER\AppData\Roaming\npm\node_modules\expo-cli
npm ERR! dest C:\Users\ACER\AppData\Roaming\npm\node_modules\.expo-cli-foqoNR8w
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\ACER\AppData\Roaming\npm\node_modules\expo-cli' -> 'C:\Users\ACER\AppData\Roaming\npm\node_modules\.expo-cli-foqoNR8w'
npm ERR! [Error: EPERM: operation not permitted, rename 'C:\Users\ACER\AppData\Roaming\npm\node_modules\expo-cli' -> 'C:\Users\ACER\AppData\Roaming\npm\node_modules\.expo-cli-foqoNR8w'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\\Users\\ACER\\AppData\\Roaming\\npm\\node_modules\\expo-cli',
npm ERR! dest: 'C:\\Users\\ACER\\AppData\\Roaming\\npm\\node_modules\\.expo-cli-foqoNR8w'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
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! C:\Users\ACER\AppData\Local\npm-cache\_logs\2021-01-10T17_18_03_575Z-debug.log
This preventing me from doing the installation of react navigation and make a new project by using 'expo' command. And i've been search this problem on and tried to solve it but it didn't work on any various ways that i've tried. I've tried to reinstall the expo-cli but it didn't work, i've tried to use yarn as well but still it didn't work. I've been re-added the path for the npm and even tried to reinstall nodejs and use any various code for updating and installing the 'expo-cli' but it didn't work as expected.
Any suggest on how do i can fix this problem ?
Run your command line as Admin and then do the following:
npm remove -g expo-cli to remove the existing CLI
and then npm i -g expo-cli to reinstall the Expo CLI.
Then you can simply login via expo login (if you were logged in) and take off from where you were!
I delete the expo file on the path :
C:\Users\ACER\AppData\Roaming\npm\node_modules\expo-cli
C:\Users\ACER\AppData\Roaming\npm\node_modules\.expo-cli-foqoNR8w
the file that i deleted : expo-cli & .expo-cli-foqoNR8w
And then try to install the expo-cli again with npm install --global expo-cli then it work. Now i can use my expo start or whatever code with 'expo' in it. And also now i can install react navigation on my project directory. And i'm running the installation by using command prompt run as admin.