unable to setup a project using vite - vite

I want to try vite, but when I try npm init #vitejs/app it throws an error saying
"Error: EPERM: operation not permitted, mkdir 'C:\Users\username'
command not found: create-app
"
what could be the reason? I have vite installed through npm

Vite init command changed to npm init vite#latest. From this PR. And the docs.

Related

Unable to install npm packages on live server- throwing error

While running npm i on server after adding a package, it throws the error below.
While resolving: eslint-config-airbnb-base#13.1.0 npm ERR! Found: eslint#6.0.1
what could be the possible reason? I am a bit new in Nodejs.
I added package-lock.json in the code and tried to upload it and run the npm i command to install the packages, previously It wasnt throwing any such error.

npm ERR! Error: EPERM: operation not permitted, when trying to install any package

Whenever tying to install any type of package I getting this error (errno -4048) operation not permitted. looking for a solution tried to kill any running server but the issue presists. Do you have an idea how to solve this?
Try this :
npm cache clean --force
npm WARN using --force Recommended protections disabled.

nodejs will not enable corepack: operation not permitted

I have installed nodejs and i am trying to enable corepack with corepack enable but it gives me this error on windows:
Internal Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\pnpm'
Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\pnpm'
I can not find the pnpm folder is is refering to in the nodejs folder and i have tried to npm install -g pnpm which did install pnpm
how do I fix this?
Try running the cmd as administrator

Create New React Native app

I am getting an error on creating my first react native app.
I am using following guide -
https://facebook.github.io/react-native/docs/getting-started.html
https://github.com/react-community/create-react-native-app
$ npm install -g create-react-native-app
--Worked fine
$ create-react-native-app my-first-native-app
--app created without errors
$ npm start
--gives error
Error: React native is not installed. Please run `npm install` in your project directory.
1:09:05: Error starting packager: Error: Couldn't start project. Please fix the errors and restart the project.
at C:\xdl\src\Project.js:1329:11
at Generator.next (<anonymous>)
at step (C:\reactJs-projects\my-first-native-app\node_modules\xdl\build\Project.js:1735:191)
at C:\reactJs-projects\my-first-native-app\node_modules\xdl\build\Project.js:1735:361
at <anonymous>
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-first-native-app#0.1.0 start: `react-native-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-first-native-app#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Tried fixing with downgrading npm to version 4 as recommended all over that version 5 has bugs.
npm i -g npm#4
I have also tried latest npm but neither of them worked.
When I run npm install on my project directory, instead of installing/updating my packages, it is giving following error
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://github.com/npm/npm/issues>
I see all dependencies downloaded in node_modules though
Any suggestion on what I have missed?
What I also noticed is when the app is created (using create-react-native-app my-first-native-app) it also added following error in console
yarn install v0.21.3
[1/4] Resolving packages...
warning jest-expo > jest > jest-cli > istanbul-api > istanbul-lib-hook#1.2.1: 1.2.0 should have been a major version bump
[2/4] Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/react-native-web-maps/-/react-native-web-maps-
0.1.0.tgz: invalid tar file".
info If you think this is a bug, please open a bug report with the information provided in "C:\\reactJs-projects
\\MyNewNativeApp\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Failed to install
Thank You!
Reinstall your NPM/YARN and get the newest version of React Native i have this problem too
after create your project with
$ create-react-native-app my-first-native-app
after you should enter your project folder :
$ cd my-first-native-app
and then open emulator or connect to tour device and run with
$ npm start
or
$ react-native run-android
pay attention you had installed android-SDK and android-JDK and your emulator is running
After trying different versions, I ended up using yarn and it worked on first instance. If anyone struggles with similar problem, then I would recommend using Yarn and move on. One can switch back to npm after the app is created. This is very common issue reported and for many developers it works with certain version.
Create new project using command : npx react-native init ProjectName
Create new project using particular version of react native :
npx react-native init ProjectName --version X.XX.X
After that go to project location
cd ProjectName
Run application on android platform
npx react-native run-android

Error: Uncaught Error: EPERM: operation not permitted, rename when installing electron app on windows

I'm creating an Electron app and when I try to install it on a Windows 7 32-bit machine I'm getting the following error:
Uncaught Error: EPERM: operation not permitted, rename 'D:\final-app\library\db\tmp_login.db~' -> 'D:\final-app\library\db\tmp_login.db'
I tried to
run cmd.exe as an administrator
run npm cache clean --force
run npm install -g npm#latest --force
But I'm still getting the same error. Am I doing something wrong?
In my situation it helped on windows:
clean cache with
npm cache clean --force
install the latest version of npm globally as admin:
npm install -g npm#latest --force
clean cache with
npm cache clean --force
Try to install your component once again.
npm ERR! Error: EPERM: operation not permitted, rename

Resources