ابوالفضل شاهی
9 ماه پیش توسط ابوالفضل شاهی مطرح شد
1 پاسخ

خطا و مشکل در نصب و اجرای npm

من در نصب npm مشکل دارم و نمی توانم npm را اجرا کنم وقتی دستور زیر را تایپ می کنم هنگام گذاشتن عکس با خطا مواجه می شوم. npp i

npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   react@"^18.2.0" from the root project
npm WARN   38 more (@dhaiwat10/react-link-preview, @emoji-mart/react, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.0.0 || ^15.0.0 || ~0.14.0" from react-instagram-embed@1.5.0
npm WARN node_modules/react-instagram-embed
npm WARN   react-instagram-embed@"^1.5.0" from react-embed@3.6.0
npm WARN   node_modules/react-embed
npm WARN
npm WARN Conflicting peer dependency: react@16.14.0
npm WARN node_modules/react
npm WARN   peer react@"^16.0.0 || ^15.0.0 || ~0.14.0" from react-instagram-embed@1.5.0
npm WARN   node_modules/react-instagram-embed
npm WARN     react-instagram-embed@"^1.5.0" from react-embed@3.6.0
npm WARN     node_modules/react-embed
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-instagram-embed@1.5.0
npm WARN Found: react-dom@18.2.0
npm WARN node_modules/react-dom
npm WARN   react-dom@"^18.2.0" from the root project
npm WARN   16 more (@dhaiwat10/react-link-preview, @mui/base, @mui/lab, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react-dom@"^16.0.0 || ^15.0.0 || ~0.14.0" from react-instagram-embed@1.5.0
npm WARN node_modules/react-instagram-embed
npm WARN   react-instagram-embed@"^1.5.0" from react-embed@3.6.0
npm WARN   node_modules/react-embed
npm WARN
npm WARN Conflicting peer dependency: react-dom@16.14.0
npm WARN node_modules/react-dom
npm WARN   peer react-dom@"^16.0.0 || ^15.0.0 || ~0.14.0" from react-instagram-embed@1.5.0
npm WARN   node_modules/react-instagram-embed
npm WARN     react-instagram-embed@"^1.5.0" from react-embed@3.6.0
npm WARN     node_modules/react-embed

up to date, audited 1928 packages in 29s

128 packages are looking for funding
  run `npm fund` for details

131 vulnerabilities (1 low, 104 moderate, 22 high, 4 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

وقتی این کد را تایپ می کنم، با مشکل زیر مواجه می شوم npm audit fix --force

PS C:\Users\Abolfazl\Desktop\chat-app-latest> npm audit fix --force
npm WARN using --force Recommended protections disabled.
npm WARN audit Updating react-scripts to 5.0.1, which is a SemVer major change.
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-instagram-embed@1.5.0
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   peer react@"^16.0.0 || ^17.0.0 || ^18.0.0" from @dhaiwat10/react-link-preview@1.15.0
npm WARN   node_modules/@dhaiwat10/react-link-preview
npm WARN     @dhaiwat10/react-link-preview@"^1.15.0" from the root project
npm WARN   39 more (@emoji-mart/react, @emotion/react, @emotion/styled, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.0.0 || ^15.0.0 || ~0.14.0" from react-instagram-embed@1.5.0
npm WARN node_modules/react-instagram-embed
npm WARN   react-instagram-embed@"^1.5.0" from react-embed@3.6.0
npm WARN   node_modules/react-embed
npm WARN
npm WARN Conflicting peer dependency: react@16.14.0
npm WARN node_modules/react
npm WARN   peer react@"^16.0.0 || ^15.0.0 || ~0.14.0" from react-instagram-embed@1.5.0
npm WARN   node_modules/react-instagram-embed
npm WARN     react-instagram-embed@"^1.5.0" from react-embed@3.6.0
npm WARN     node_modules/react-embed
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-instagram-embed@1.5.0
npm WARN Found: react-dom@18.2.0
npm WARN node_modules/react-dom
npm WARN   peer react-dom@"^16.0.0 || ^17.0.0 || ^18.0.0" from @dhaiwat10/react-link-preview@1.15.0
npm WARN   node_modules/@dhaiwat10/react-link-preview
npm WARN     @dhaiwat10/react-link-preview@"^1.15.0" from the root project
npm WARN   16 more (@mui/base, @mui/lab, @mui/material, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react-dom@"^16.0.0 || ^15.0.0 || ~0.14.0" from react-instagram-embed@1.5.0
npm WARN node_modules/react-instagram-embed
npm WARN   react-instagram-embed@"^1.5.0" from react-embed@3.6.0
npm WARN   node_modules/react-embed
npm WARN
npm WARN Conflicting peer dependency: react-dom@16.14.0
npm WARN node_modules/react-dom
npm WARN   peer react-dom@"^16.0.0 || ^15.0.0 || ~0.14.0" from react-instagram-embed@1.5.0
npm WARN   node_modules/react-instagram-embed
npm WARN     react-instagram-embed@"^1.5.0" from react-embed@3.6.0
npm WARN     node_modules/react-embed
npm WARN deprecated @babel/plugin-proposal-private-methods@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.
npm WARN deprecated @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
npm WARN deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
npm WARN deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm WARN deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm WARN deprecated domexception@2.0.1: Use your platform's native DOMException instead
npm WARN deprecated workbox-cacheable-response@6.6.0: workbox-background-sync@6.6.0

added 545 packages, removed 772 packages, changed 365 packages, and audited 1701 packages in 4m

264 packages are looking for funding
  run `npm fund` for details

# npm audit report

nth-check  <2.0.1
Severity: high
Inefficient Regular Expression Complexity in nth-check - https://github.com/advisories/GHSA-rp65-9cf3-cjxr
fix available via `npm audit fix --force`
Will install react-scripts@3.0.1, which is a breaking change
node_modules/svgo/node_modules/nth-check
  css-select  <=3.1.0
  Depends on vulnerable versions of nth-check
  node_modules/svgo/node_modules/css-select
    svgo  1.0.0 - 1.3.2
    Depends on vulnerable versions of css-select
    node_modules/svgo
      @svgr/plugin-svgo  <=5.5.0
      Depends on vulnerable versions of svgo
      node_modules/@svgr/plugin-svgo
        @svgr/webpack  4.0.0 - 5.5.0
        Depends on vulnerable versions of @svgr/plugin-svgo
        node_modules/@svgr/webpack
          react-scripts  >=2.1.4
          Depends on vulnerable versions of @svgr/webpack
          Depends on vulnerable versions of resolve-url-loader
          node_modules/react-scripts

postcss  <8.4.31
Severity: moderate
PostCSS line return parsing error - https://github.com/advisories/GHSA-7fh5-64p2-3v2j
fix available via `npm audit fix --force`
Will install react-scripts@3.0.1, which is a breaking change
node_modules/resolve-url-loader/node_modules/postcss
  resolve-url-loader  0.0.1-experiment-postcss || 3.0.0-alpha.1 - 4.0.0
  Depends on vulnerable versions of postcss
  node_modules/resolve-url-loader

8 vulnerabilities (2 moderate, 6 high)

To address all issues (including breaking changes), run:
  npm audit fix --force

طبق تحقیقات من، اینها خطا نیستند، اما وقتی می خواهم npm را اجرا کنم، با مشکل زیر مواجه می شوم npm run start

PS C:\Users\Abolfazl\Desktop\chat-app-latest> npm run start

> c@0.1.0 start
> react-scripts start

node:internal/modules/cjs/loader:1147
  throw err;
  ^

Error: Cannot find module './promise'
Require stack:
- C:\Users\Abolfazl\Desktop\chat-app-latest\node_modules\bluebird\js\release\bluebird.js
- C:\Users\Abolfazl\Desktop\chat-app-latest\node_modules\cacache\lib\entry-index.js
- C:\Users\Abolfazl\Desktop\chat-app-latest\node_modules\cacache\ls.js
- C:\Users\Abolfazl\Desktop\chat-app-latest\node_modules\cacache\locales\en.js
- C:\Users\Abolfazl\Desktop\chat-app-latest\node_modules\cacache\index.js
- C:\Users\Abolfazl\Desktop\chat-app-latest\node_modules\terser-webpack-plugin\dist\TaskRunner.js
- C:\Users\Abolfazl\Desktop\chat-app-latest\node_modules\terser-webpack-plugin\dist\index.js
- C:\Users\Abolfazl\Desktop\chat-app-latest\node_modules\terser-webpack-plugin\dist\cjs.js
- C:\Users\Abolfazl\Desktop\chat-app-latest\node_modules\react-scripts\config\webpack.config.js
- C:\Users\Abolfazl\Desktop\chat-app-latest\node_modules\react-scripts\scripts\start.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (C:\Users\Abolfazl\Desktop\chat-app-latest\node_modules\bluebird\js\release\bluebird.js:9:16)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\Abolfazl\\Desktop\\chat-app-latest\\node_modules\\bluebird\\js\\release\\bluebird.js',
    'C:\\Users\\Abolfazl\\Desktop\\chat-app-latest\\node_modules\\cacache\\lib\\entry-index.js',
    'C:\\Users\\Abolfazl\\Desktop\\chat-app-latest\\node_modules\\cacache\\ls.js',
    'C:\\Users\\Abolfazl\\Desktop\\chat-app-latest\\node_modules\\cacache\\locales\\en.js',
    'C:\\Users\\Abolfazl\\Desktop\\chat-app-latest\\node_modules\\cacache\\index.js',
    'C:\\Users\\Abolfazl\\Desktop\\chat-app-latest\\node_modules\\terser-webpack-plugin\\dist\\TaskRunner.js',
    'C:\\Users\\Abolfazl\\Desktop\\chat-app-latest\\node_modules\\terser-webpack-plugin\\dist\\index.js',
    'C:\\Users\\Abolfazl\\Desktop\\chat-app-latest\\node_modules\\terser-webpack-plugin\\dist\\cjs.js',
    'C:\\Users\\Abolfazl\\Desktop\\chat-app-latest\\node_modules\\react-scripts\\config\\webpack.config.js',
    'C:\\Users\\Abolfazl\\Desktop\\chat-app-latest\\node_modules\\react-scripts\\scripts\\start.js'
  ]
}

Node.js v20.10.0

لطفا به من کمک کنید.


ثبت پرسش جدید
سهیل حیدری
@hbr 9 ماه پیش مطرح شد
0

سلام عزیز موقع نصب پکیج ها وارنینگ داری که مربوط به وابستگی ها است که نسخه هاش همخونی نداره ولی مشکلی پیش نمیاد ولی برای خطایت میگه این ماژول وجود نداره Error: Cannot find module './promise' که باید کتابخونه مربوطه رو بررسی کنی با اینکه تو کدت یه جایی همچین ماژولی رو فراخونی کردی که موجود نیست ولی به نظر از کتابخونه هست که میگه این ماژول وجود نداره


برای ارسال پاسخ لازم است وارد شده یا ثبت‌نام کنید

ورود یا ثبت‌نام