روی نصب npm-creact-app مشکل دارم لطفا کمک کنید
موقع نضب ارور میده
سلام دوست عزیز. دستوری که باید برای نصب اجرا کنید این هست :
npm i create-react-appدقیق همینو میزنم ولی ارور میده
اینو میده :
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
added 67 packages, and audited 68 packages in 22s
4 packages are looking for funding
run `npm fund` for details
3 high severity vulnerabilities
To address all issues, run:
npm audit fix
Run `npm audit` for details.
سلام.
برای نصب ریکت از این دستور استفاده کنید:
npx create-react-app@5.0.0 my-app
این ارور رو داد
Need to install the following packages:
create-react-app@5.0.0
Ok to proceed? (y)
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
The directory my-app contains files that could conflict.
Try using a new directory name.
لطفا کمک کنید
به جای my-app از نام دیگه ای استفاده کنید یا فولدر my-app رو کاملا پاک کنید و دوباره تلاش کنید
این دستور رو استفاده کن
npx create-react-app name-app
بخش اولش کلمات کلیدی هستن که ضروری هستن ینی این npx create-react-app
بخش دوم اسم فولدر پروژته اختیاری هرچی میتونی بزاری ینی این name-app
مثلا من npx create-react-app mojtaba
اینو میزنم یکی دیگه اسم خودشو اون دش اپ ته اسم پروژتم اختیاریه
اما واسه نصب بصورت گلوبال منم همین ارور خودتو گرفتم با همینم کارت را میفته
ارور داد
سلام دوست من
اول به کمک npm نصب کنید ابزاری به نام yarn
npm i -g yarnبعد سعی بر ساخت پروژه جدید کنید. نام پروژه بسیار مهم هست نباید از خط فاصله یا کاراکترهای غیرمجاز استفاده کنید
npx create-react-app firstprojectاگر خطایی داد متن خطا رو قرار بدید
همچنین چک کنید که nodejs به درستی در سیستم عامل نصب شده باشه و نسخه ایی که نصب کردید نسخه lts باشه
با دستور زیر چک کنید
node -v
npm -vاگر ورژن هر ۲ بدون هیچ خطایی نمایش داده شد هیچ مشکلی نخواهد بود.
در ضمن در ویندوز ۷ خطاهای احتمالی بسیار زیادی خواهد بود و سعی کنید اگر ویندوز ۷ استفاده میکنید به ویندوز ۱۰ ارتقا بدید.
موفق باشید
خیلی ممنون اگه خطا داد حتما میگم
Installing packages. This might take a couple minutes.
Installing react, react-dom, and react-scripts...
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
added 1366 packages, and audited 1367 packages in 4m
169 packages are looking for funding
run `npm fund` for details
6 moderate severity vulnerabilities
To address all issues, run:
npm audit fix
Run `npm audit` for details.
A template was not provided. This is likely because you're using an outdated version of create-react-app.
Please note that global installs of create-react-app are no longer supported.
You can fix this by running npm uninstall -g create-react-app or yarn global remove create-react-app before using create-react-app again.
ابن ارور رو داد
اگر create-react-app به صورت گلوبال در سیستم نصب هست پاکش کن
npm un -g create-react-appو بعد با استفاده از از npx سعی بر ساخت محیط توسعه کن
npx create-react-app firstprojectاگر نشد با فعال سازی ابزار ضد تحریم امتحان کن
در ضمن این خطا نیست و هشدار هست
با اینکه هشدار داده باید پروژه رو آماده کرده باشه براتون که بتونید استفاده کنید
این ارور رو داد
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\Program Files\nodejs\node_modules\create-react-app
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\create-react-app'
npm ERR! [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\create-react-app'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: 'C:\\Program Files\\nodejs\\node_modules\\create-react-app'
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\IRANIAN-T\AppData\Local\npm-cache\_logs\2022-03-07T12_54_24_018Z-debug-0.log
از چه دستوری استفاده کردی که این خطا رو داد؟
مشکل میتونه دلیل بسیار زیادی داشته باشه
پیشنهاد میکنم خطاهای دریافتی رو جستجو کنی و راه حل های پیشنهاد شده رو تست کنی تا بفهمیم مشکل از کجاست
امکانش هست که مشکل از پیکربندی که سیستم عامل و مجوز کافی نداشتن باشه
میتونه از نام کاربری شما باشه که تماما به صورت حروف بزرگ و سیمبل - هست
میتونه از کش npm باشه که شاید نیاز به پاک کردنش هست
شاید nodejs به درستی نصب نشده باشه
و ...
جستجو کنید و راه حل های پیشنهادی رو تست کنید