首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >当我在Laravel 9中安装npm时,出现了一些奇怪的错误。

当我在Laravel 9中安装npm时,出现了一些奇怪的错误。
EN

Stack Overflow用户
提问于 2022-09-13 15:02:24
回答 3查看 281关注 0票数 0

我试图在Laravel 9站点安装npm,却发现了一些奇怪的错误:

代码语言:javascript
运行
复制
npm install
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: bootstrap-switch@3.3.4
npm WARN Found: bootstrap@4.6.2
npm WARN node_modules/bootstrap
npm WARN   dev bootstrap@"^4.6.0" from the root project
npm WARN   3 more (admin-lte, bootstrap-colorpicker, tempusdominus-bootstrap-4)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer bootstrap@"^3.1.1" from bootstrap-switch@3.3.4
npm WARN node_modules/bootstrap-switch
npm WARN   bootstrap-switch@"3.3.4" from admin-lte@3.2.0
npm WARN   node_modules/admin-lte
npm WARN
npm WARN Conflicting peer dependency: bootstrap@3.4.1
npm WARN node_modules/bootstrap
npm WARN   peer bootstrap@"^3.1.1" from bootstrap-switch@3.3.4
npm WARN   node_modules/bootstrap-switch
npm WARN     bootstrap-switch@"3.3.4" from admin-lte@3.2.0
npm WARN     node_modules/admin-lte
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated flag-icon-css@4.1.7: The project has been renamed to flag-icons
npm notice
npm notice New minor version of npm available! 8.15.0 -> 8.19.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.19.1
npm notice Run npm install -g npm@8.19.1 to update!
npm notice
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /usr/bin/node /usr/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/home/hoster/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN old lockfile
npm ERR! npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm ERR! npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm ERR! npm WARN old lockfile
npm ERR! npm WARN old lockfile This is a one-time fix-up, please be patient...
npm ERR! npm WARN old lockfile
npm ERR! npm WARN old lockfile vue-next: No matching version found for vue-next@3.2.37.
npm ERR! npm WARN old lockfile     at module.exports (/usr/lib/node_modules/npm/node_modules/npm-pick-manifest/lib/index.js:209:23)
npm ERR! npm WARN old lockfile     at RegistryFetcher.manifest (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:125:22)
npm ERR! npm WARN old lockfile     at async Array.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:784:9)
npm ERR! npm WARN old lockfile  Could not fetch metadata for vue-next@3.2.37 vue-next: No matching version found for vue-next@3.2.37.
npm ERR! npm WARN old lockfile     at module.exports (/usr/lib/node_modules/npm/node_modules/npm-pick-manifest/lib/index.js:209:23)
npm ERR! npm WARN old lockfile     at RegistryFetcher.manifest (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:125:22)
npm ERR! npm WARN old lockfile     at async Array.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:784:9) {
npm ERR! npm WARN old lockfile   code: 'ETARGET',
npm ERR! npm WARN old lockfile   type: 'version',
npm ERR! npm WARN old lockfile   wanted: '3.2.37',
npm ERR! npm WARN old lockfile   versions: [ '0.0.1' ],
npm ERR! npm WARN old lockfile   distTags: { latest: '0.0.1' },
npm ERR! npm WARN old lockfile   defaultTag: 'latest'
npm ERR! npm WARN old lockfile }
npm ERR! npm WARN old lockfile HttpErrorGeneral: 404 Not Found - GET https://registry.npmjs.org/vue-next-test-utils - Not found
npm ERR! npm WARN old lockfile     at /usr/lib/node_modules/npm/node_modules/npm-registry-fetch/lib/check-response.js:93:15
npm ERR! npm WARN old lockfile     at runMicrotasks (<anonymous>)
npm ERR! npm WARN old lockfile     at processTicksAndRejections (node:internal/process/task_queues:96:5)
npm ERR! npm WARN old lockfile     at async RegistryFetcher.packument (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:92:19)
npm ERR! npm WARN old lockfile     at async RegistryFetcher.manifest (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:124:23)
npm ERR! npm WARN old lockfile     at async Array.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:784:9)
npm ERR! npm WARN old lockfile  Could not fetch metadata for vue-next-test-utils@2.0.0-rc.16 HttpErrorGeneral: 404 Not Found - GET https://registry.npmjs.org/vue-next-test-utils - Not found
npm ERR! npm WARN old lockfile     at /usr/lib/node_modules/npm/node_modules/npm-registry-fetch/lib/check-response.js:93:15
npm ERR! npm WARN old lockfile     at runMicrotasks (<anonymous>)
npm ERR! npm WARN old lockfile     at processTicksAndRejections (node:internal/process/task_queues:96:5)
npm ERR! npm WARN old lockfile     at async RegistryFetcher.packument (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:92:19)
npm ERR! npm WARN old lockfile     at async RegistryFetcher.manifest (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:124:23)
npm ERR! npm WARN old lockfile     at async Array.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:784:9) {
npm ERR! npm WARN old lockfile   headers: [Object: null prototype] {
npm ERR! npm WARN old lockfile     date: [ 'Mon, 12 Sep 2022 12:27:07 GMT' ],
npm ERR! npm WARN old lockfile     'content-type': [ 'application/json' ],
npm ERR! npm WARN old lockfile     'content-length': [ '21' ],
npm ERR! npm WARN old lockfile     connection: [ 'keep-alive' ],
npm ERR! npm WARN old lockfile     'cf-ray': [ '7498a2ad69ce9bb0-FRA' ],
npm ERR! npm WARN old lockfile     vary: [ 'Accept-Encoding' ],
npm ERR! npm WARN old lockfile     server: [ 'cloudflare' ],
npm ERR! npm WARN old lockfile     'x-fetch-attempts': [ '1' ],
npm ERR! npm WARN old lockfile     'x-local-cache-status': [ 'skip' ]
npm ERR! npm WARN old lockfile   },
npm ERR! npm WARN old lockfile   statusCode: 404,
npm ERR! npm WARN old lockfile   code: 'E404',
npm ERR! npm WARN old lockfile   method: 'GET',
npm ERR! npm WARN old lockfile   uri: 'https://registry.npmjs.org/vue-next-test-utils',
npm ERR! npm WARN old lockfile   body: { error: 'Not found' },
npm ERR! npm WARN old lockfile   pkgid: 'vue-next-test-utils@2.0.0-rc.16'
npm ERR! npm WARN old lockfile }
npm ERR! npm WARN old lockfile HttpErrorGeneral: 404 Not Found - GET https://registry.npmjs.org/vue-next-rollup-plugin-vue - Not found
npm ERR! npm WARN old lockfile     at /usr/lib/node_modules/npm/node_modules/npm-registry-fetch/lib/check-response.js:93:15
npm ERR! npm WARN old lockfile     at runMicrotasks (<anonymous>)
npm ERR! npm WARN old lockfile     at processTicksAndRejections (node:internal/process/task_queues:96:5)
npm ERR! npm WARN old lockfile     at async RegistryFetcher.packument (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:92:19)
npm ERR! npm WARN old lockfile     at async RegistryFetcher.manifest (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:124:23)
npm ERR! npm WARN old lockfile     at async Array.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:784:9)
npm ERR! npm WARN old lockfile  Could not fetch metadata for vue-next-rollup-plugin-vue@6.0.0 HttpErrorGeneral: 404 Not Found - GET https://registry.npmjs.org/vue-next-rollup-plugin-vue - Not found
npm ERR! npm WARN old lockfile     at /usr/lib/node_modules/npm/node_modules/npm-registry-fetch/lib/check-response.js:93:15
npm ERR! npm WARN old lockfile     at runMicrotasks (<anonymous>)
npm ERR! npm WARN old lockfile     at processTicksAndRejections (node:internal/process/task_queues:96:5)
npm ERR! npm WARN old lockfile     at async RegistryFetcher.packument (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:92:19)
npm ERR! npm WARN old lockfile     at async RegistryFetcher.manifest (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:124:23)
npm ERR! npm WARN old lockfile     at async Array.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:784:9) {
npm ERR! npm WARN old lockfile   headers: [Object: null prototype] {
npm ERR! npm WARN old lockfile     date: [ 'Mon, 12 Sep 2022 12:27:07 GMT' ],
npm ERR! npm WARN old lockfile     'content-type': [ 'application/json' ],
npm ERR! npm WARN old lockfile     'content-length': [ '21' ],
npm ERR! npm WARN old lockfile     connection: [ 'keep-alive' ],
npm ERR! npm WARN old lockfile     'cf-ray': [ '7498a2adadf0695e-FRA' ],
npm ERR! npm WARN old lockfile     vary: [ 'Accept-Encoding' ],
npm ERR! npm WARN old lockfile     server: [ 'cloudflare' ],
npm ERR! npm WARN old lockfile     'x-fetch-attempts': [ '1' ],
npm ERR! npm WARN old lockfile     'x-local-cache-status': [ 'skip' ]
npm ERR! npm WARN old lockfile   },


                                        ...
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     /home/hoster/.npm/_logs/2022-09-12T12_26_51_309Z-debug-0.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/hoster/.npm/_logs/2022-09-12T12_25_43_401Z-debug-0.log

我看到留言了

代码语言:javascript
运行
复制
7507 error npm WARN old lockfile The package-lock.json file was created with an old version of npm,

代码语言:javascript
运行
复制
7507 error npm WARN old lockfile vue-next: No matching version found for vue-next@3.2.37.
7507 error npm WARN old lockfile     at module.exports (/usr/lib/node_modules/npm/node_modules/npm-pick-manifest/lib/index.js:209:23)

在运行安装命令之前,我删除了项目根目录中的所有锁文件。

代码语言:javascript
运行
复制
hoster@hoster-os:/Project$ node -v
v16.17.0
hoster@hoster-os:/Project$ npm -v
8.15.0
hoster@hoster-os:/Project$ uname -a
Linux hoster-os 5.15.0-41-generic #44~20.04.1-Ubuntu SMP Fri Jun 24 13:27:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

在package.json中,我有:

代码语言:javascript
运行
复制
{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "mix",
        "watch": "mix watch",
        "watch-poll": "mix watch -- --watch-options-poll=1000",
        "hot": "mix watch --hot",
        "prod": "npm run production",
        "production": "mix --production"
    },
    "devDependencies": {
        "@fortawesome/fontawesome-free": "^5.15.4",
        "@inertiajs/inertia": "^0.10.0",
        "@inertiajs/inertia-vue3": "^0.5.1",
        "@inertiajs/progress": "^0.2.6",
        "@tailwindcss/forms": "^0.4.0",
        "@tailwindcss/typography": "^0.5.0",
        "@vue/compiler-sfc": "^3.0.5",
        "admin-lte": "^3.1.0",
        "axios": "^0.25",
        "bootstrap": "^4.6.0",
        "laravel-echo": "^1.11.7",
        "laravel-mix": "^6.0.6",
        "lodash": "^4.17.19",
        "overlayscrollbars": "^1.13.0",
        "popper.js": "^1.16.1",
        "postcss": "^8.1.14",
        "postcss-import": "^12.0.1",
        "pusher-js": "^7.1.0-beta",
        "resolve-url-loader": "^5.0.0",
        "sass": "^1.49.8",
        "sass-loader": "^12.6.0",
        "tailwindcss": "^3.0.0",
        "vue": "^3.2.30",
        "vue-loader": "^16.1.2"
    },
    "dependencies": {
        "@ckeditor/ckeditor5-build-classic": "^32.0.0",
        "@ckeditor/ckeditor5-vue": "^2.0.1",
        "@vueform/multiselect": "github:vueform/multiselect",
        "@vuepic/vue-datepicker": "^3.1.1",
        "@vueup/vue-quill": "^1.0.0-beta.8",
        "codemirror": "^6.0.1",
        "mitt": "^3.0.0",
        "quill-better-table": "^1.2.10",
        "quill-blot-formatter": "^1.0.5",
        "sanitize-html": "^2.7.0",
        "vue-color-kit": "^1.0.5",
        "vue-final-modal": "^3.4.3",
        "vue-upload-component": "^3.1.2",
        "vue3-colorpicker": "^2.0.4",
        "vuejs-paginate-next": "^1.0.2"
    }
}

为什么我会有这个错误,以及如何修复它?

更新信息:

我试图遵循链接中的步骤,但仍然出错:

  1. I从应用程序根目录中删除了文件composer.lock和Packy-lock.json,手动删除了node_modules和供应商

子目录。

  1. I运行命令

作曲家安装

取得成功

  1. I在sudo下运行命令(否则会有访问错误):sudo安装-g npm@8.19.1以更新

取得成功,但也有一些警告:

代码语言:javascript
运行
复制
npm WARN deprecated set-value@0.4.3: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm WARN deprecated set-value@0.3.3: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm WARN deprecated set-value@0.3.3: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm WARN deprecated set-value@0.3.3: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm WARN deprecated set-value@0.4.3: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm WARN deprecated set-value@0.4.3: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm WARN deprecated set-value@0.4.3: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm WARN deprecated set-value@0.3.3: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm WARN deprecated set-value@0.3.3: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm WARN deprecated set-value@0.3.3: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm WARN deprecated set-value@0.2.0: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm WARN deprecated set-value@0.4.3: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm WARN deprecated set-value@0.3.3: Critical bug fixed in v3.0.1, please upgrade to the latest version.

changed 657 packages, and audited 853 packages in 2m

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

53 vulnerabilities (7 low, 3 moderate, 41 high, 2 critical)

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

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

Some issues need review, and may require choosing
a different dependency.

  1. 和check版本:

$ npm -v 8.19.1

  1. 清除缓存:

npm缓存干净-强制npm警告使用-强制建议保护禁用。

  1. 但是运行npm安装我又出错了:

代码语言:javascript
运行
复制
    hoster@hoster-os:/Project$ npm install
    npm WARN ERESOLVE overriding peer dependency
    npm WARN While resolving: bootstrap-switch@3.3.4
    npm WARN Found: bootstrap@4.6.2
    npm WARN node_modules/bootstrap
    npm WARN   dev bootstrap@"^4.6.0" from the root project
    npm WARN   3 more (admin-lte, bootstrap-colorpicker, tempusdominus-bootstrap-4)
    npm WARN
    npm WARN Could not resolve dependency:
    npm WARN peer bootstrap@"^3.1.1" from bootstrap-switch@3.3.4
    npm WARN node_modules/bootstrap-switch
    npm WARN   bootstrap-switch@"3.3.4" from admin-lte@3.2.0
    npm WARN   node_modules/admin-lte
    npm WARN
    npm WARN Conflicting peer dependency: bootstrap@3.4.1
    npm WARN node_modules/bootstrap
    npm WARN   peer bootstrap@"^3.1.1" from bootstrap-switch@3.3.4
    npm WARN   node_modules/bootstrap-switch
    npm WARN     bootstrap-switch@"3.3.4" from admin-lte@3.2.0
    npm WARN     node_modules/admin-lte
    npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
    npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
    npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
    npm WARN deprecated flag-icon-css@4.1.7: The project has been renamed to flag-icons
    npm ERR! code 1
    npm ERR! git dep preparation failed
    npm ERR! command /usr/bin/node /usr/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/home/hoster/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
    npm ERR! npm WARN using --force Recommended protections disabled.
    npm ERR! npm WARN old lockfile
    npm ERR! npm WARN old lockfile The package-lock.json file was created with an old version of npm,
    npm ERR! npm WARN old lockfile so supplemental metadata must be fetched from the registry.
    npm ERR! npm WARN old lockfile
    npm ERR! npm WARN old lockfile This is a one-time fix-up, please be patient...
    npm ERR! npm WARN old lockfile
    npm ERR! npm WARN old lockfile vue-next: No matching version found for vue-next@3.2.37.
    npm ERR! npm WARN old lockfile     at module.exports (/usr/lib/node_modules/npm/node_modules/npm-pick-manifest/lib/index.js:209:23)
    npm ERR! npm WARN old lockfile     at RegistryFetcher.manifest (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:125:22)
    npm ERR! npm WARN old lockfile     at async Array.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:738:24)
    npm ERR! npm WARN old lockfile  Could not fetch metadata for vue-next@3.2.37 vue-next: No matching version found for vue-next@3.2.37.
    npm ERR! npm WARN old lockfile     at module.exports (/usr/lib/node_modules/npm/node_modules/npm-pick-manifest/lib/index.js:209:23)
    npm ERR! npm WARN old lockfile     at RegistryFetcher.manifest (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:125:22)
    npm ERR! npm WARN old lockfile     at async Array.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:738:24) {
    npm ERR! npm WARN old lockfile   code: 'ETARGET',
    npm ERR! npm WARN old lockfile   type: 'version',
    npm ERR! npm WARN old lockfile   wanted: '3.2.37',
    npm ERR! npm WARN old lockfile   versions: [ '0.0.1' ],
    npm ERR! npm WARN old lockfile   distTags: { latest: '0.0.1' },
    npm ERR! npm WARN old lockfile   defaultTag: 'latest'
    npm ERR! npm WARN old lockfile }
    npm ERR! npm WARN old lockfile HttpErrorGeneral: 404 Not Found - GET https://registry.npmjs.org/vue-next-rollup-plugin-vue - Not found
    npm ERR! npm WARN old lockfile     at /usr/lib/node_modules/npm/node_modules/npm-registry-fetch/lib/check-response.js:95:15
    npm ERR! npm WARN old lockfile     at runMicrotasks (<anonymous>)
    npm ERR! npm WARN old lockfile     at processTicksAndRejections (node:internal/process/task_queues:96:5)
    npm ERR! npm WARN old lockfile     at async RegistryFetcher.packument (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:92:19)
    npm ERR! npm WARN old lockfile     at async RegistryFetcher.manifest (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:124:23)
    npm ERR! npm WARN old lockfile     at async Array.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:738:24)
    npm ERR! npm WARN old lockfile  Could not fetch metadata for vue-next-rollup-plugin-vue@6.0.0 HttpErrorGeneral: 404 Not Found - GET https://registry.npmjs.org/vue-next-rollup-plugin-vue - Not found
    npm ERR! npm WARN old lockfile     at /usr/lib/node_modules/npm/node_modules/npm-registry-fetch/lib/check-response.js:95:15
    npm ERR! npm WARN old lockfile     at runMicrotasks (<anonymous>)
    npm ERR! npm WARN old lockfile     at processTicksAndRejections (node:internal/process/task_queues:96:5)
    npm ERR! npm WARN old lockfile     'content-type': [ 'application/json' ],
    npm ERR! npm WARN old lockfile     'content-length': [ '21' ],
    npm ERR! npm WARN old lockfile     connection: [ 'keep-alive' ],
    npm ERR! npm WARN old lockfile     'cf-ray': [ '74c9ec85b945bbb0-FRA' ],
    npm ERR! npm WARN old lockfile     vary: [ 'Accept-Encoding' ],
    npm ERR! npm WARN old lockfile     server: [ 'cloudflare' ],
    npm ERR! npm WARN old lockfile     'x-fetch-attempts': [ '1' ],
    npm ERR! npm WARN old lockfile     'x-local-cache-status': [ 'skip' ]
    npm ERR! npm WARN old lockfile   },
    npm ERR! npm WARN old lockfile   statusCode: 404,
    npm ERR! npm WARN old lockfile   code: 'E404',
    npm ERR! npm WARN old lockfile   method: 'GET',
    npm ERR! npm WARN old lockfile   uri: 'https://registry.npmjs.org/vue-next-rollup-plugin-vue',
    npm ERR! npm WARN old lockfile   body: { error: 'Not found' },
    npm ERR! npm WARN old lockfile   pkgid: 'vue-next-rollup-plugin-vue@6.0.0'
    npm ERR! npm WARN old lockfile }
    npm ERR! npm WARN old lockfile HttpErrorGeneral: 404 Not Found - GET https://registry.npmjs.org/vue-prev - Not found
    npm ERR! npm WARN old lockfile     at /usr/lib/node_modules/npm/node_modules/npm-registry-fetch/lib/check-response.js:95:15
    npm ERR! npm WARN old lockfile     at runMicrotasks (<anonymous>)
    npm ERR! npm WARN old lockfile     at processTicksAndRejections (node:internal/process/task_queues:96:5)
    npm ERR! npm WARN old lockfile     at async RegistryFetcher.packument (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:92:19)
    npm ERR! npm WARN old lockfile     at async RegistryFetcher.manifest (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:124:23)
    npm ERR! npm WARN old lockfile     at async Array.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:738:24)
    npm ERR! npm WARN old lockfile  Could not fetch metadata for vue-prev@2.7.8 HttpErrorGeneral: 404 Not Found - GET https://registry.npmjs.org/vue-prev - Not found
    npm ERR! npm WARN old lockfile     at /usr/lib/node_modules/npm/node_modules/npm-registry-fetch/lib/check-response.js:95:15
    npm ERR! npm WARN old lockfile     at runMicrotasks (<anonymous>)
    npm ERR! npm WARN old lockfile     at processTicksAndRejections (node:internal/process/task_queues:96:5)
    npm ERR! npm WARN old lockfile     at async RegistryFetcher.packument (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:92:19)
    npm ERR! npm WARN old lockfile     at async RegistryFetcher.manifest (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:124:23)
    npm ERR! npm WARN old lockfile     at async Array.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:738:24) {
    npm ERR! npm WARN old lockfile   headers: [Object: null prototype] {
    npm ERR! npm WARN old lockfile     date: [ 'Sun, 18 Sep 2022 12:00:55 GMT' ],
    npm ERR! npm WARN old lockfile     'content-type': [ 'application/json' ],
    npm ERR! npm WARN old lockfile     'content-length': [ '21' ],
    npm ERR! npm WARN old lockfile     connection: [ 'keep-alive' ],
    npm ERR! npm WARN old lockfile     'cf-ray': [ '74c9ec86fbe39054-FRA' ],
    npm ERR! npm WARN old lockfile     vary: [ 'Accept-Encoding' ],
    npm ERR! npm WARN old lockfile     server: [ 'cloudflare' ],
    npm ERR! npm WARN old lockfile     'x-fetch-attempts': [ '1' ],
    npm ERR! npm WARN old lockfile     'x-local-cache-status': [ 'skip' ]
    npm ERR! npm WARN old lockfile   },
    npm ERR! npm WARN old lockfile   statusCode: 404,
    npm ERR! npm WARN old lockfile   code: 'E404',
    npm ERR! npm WARN old lockfile   method: 'GET',
    npm ERR! npm WARN old lockfile   uri: 'https://registry.npmjs.org/vue-prev',
    npm ERR! npm WARN old lockfile   body: { error: 'Not found' },
    npm ERR! npm WARN old lockfile   pkgid: 'vue-prev@2.7.8'
    npm ERR! npm WARN old lockfile }
    npm ERR! npm WARN old lockfile HttpErrorGeneral: 404 Not Found - GET https://registry.npmjs.org/vue-next-jest - Not found
    npm ERR! npm WARN old lockfile     at /usr/lib/node_modules/npm/node_modules/npm-registry-fetch/lib/check-response.js:95:15
    npm ERR! npm WARN old lockfile     at runMicrotasks (<anonymous>)
    npm ERR! npm WARN old lockfile     at processTicksAndRejections (node:internal/process/task_queues:96:5)
    npm ERR! npm WARN old lockfile     at async RegistryFetcher.packument (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:92:19)
    npm ERR! npm WARN old lockfile     at async RegistryFetcher.manifest (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:124:23)
    npm ERR! npm WARN old lockfile     at async Array.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:738:24)
    npm ERR! npm WARN old lockfile  Could not fetch metadata for vue-next-jest@27.0.0 HttpErrorGeneral: 404 Not Found - GET https://registry.npmjs.org/vue-next-jest - Not found
    npm ERR! npm WARN old lockfile     at /usr/lib/node_modules/npm/node_modules/npm-registry-fetch/lib/check-response.js:95:15
    npm ERR! npm WARN old lockfile     at runMicrotasks (<anonymous>)
    npm ERR! npm WARN old lockfile     at processTicksAndRejections (node:internal/process/task_queues:96:5)
    npm ERR! npm WARN old lockfile     at async RegistryFetcher.packument (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:92:19)
    npm ERR! npm WARN old lockfile     at async RegistryFetcher.manifest (/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:124:23)
    npm ERR! npm WARN old lockfile     at async Array.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:738:24) {
    npm ERR! npm WARN old lockfile   headers: [Object: null prototype] {
    npm ERR! npm WARN old lockfile     date: [ 'Sun, 18 Sep 2022 12:00:55 GMT' ],
    npm ERR! npm WARN old lockfile     'content-type': [ 'application/json' ],
    npm ERR! npm WARN old lockfile     'content-length': [ '21' ],
    npm ERR! npm WARN old lockfile     connection: [ 'keep-alive' ],
    npm ERR! npm WARN old lockfile     'cf-ray': [ '74c9ec8859a05c56-FRA' ],
    npm ERR! npm WARN old lockfile     vary: [ 'Accept-Encoding' ],
    npm ERR! npm WARN old lockfile     server: [ 'cloudflare' ],
    ...
    npm ERR! npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
    npm ERR! npm ERR! gyp ERR! stack     at ChildProcess.onExit (/home/hoster/.npm/_cacache/tmp/git-clonesvo8QA/node_modules/node-gyp/lib/build.js:194:23)
    npm ERR! npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
    npm ERR! npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
    npm ERR! npm ERR! gyp ERR! System Linux 5.15.0-41-generic
    npm ERR! npm ERR! gyp ERR! command "/usr/bin/node" "/home/hoster/.npm/_cacache/tmp/git-clonesvo8QA/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
    npm ERR! npm ERR! gyp ERR! cwd /home/hoster/.npm/_cacache/tmp/git-clonesvo8QA/node_modules/node-sass
    npm ERR! npm ERR! gyp ERR! node -v v16.17.0
    npm ERR! npm ERR! gyp ERR! node-gyp -v v7.1.2
    npm ERR! npm ERR! gyp ERR! not ok
    npm ERR! npm ERR! Build failed with error code: 1
    npm ERR!
    npm ERR! npm ERR! A complete log of this run can be found in:
    npm ERR! npm ERR!     /home/hoster/.npm/_logs/2022-09-18T12_00_30_495Z-debug-0.log
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/hoster/.npm/_logs/2022-09-18T11_58_50_566Z-debug-0.log

7) Again I pay attention at lines in error :


    npm ERR! npm WARN old lockfile The package-lock.json file was created with an old version of npm,
    npm ERR! npm WARN old lockfile so supplemental metadata must be fetched from the registry.
    npm ERR! npm WARN old lockfile
    npm ERR! npm WARN old lockfile This is a one-time fix-up, please be patient...
    npm ERR! npm WARN old lockfile
    npm ERR! npm WARN old lockfile vue-next: No matching version found for vue-next@3.2.37.

在运行npm安装之前,我已经删除了Packy-lock.json文件吗?

提前感谢!

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2022-09-27 17:18:37

尝试使用Node v14时,我对Node v16也有同样的问题,因为该项目有一些旧的依赖项,这些依赖关系已经过时,并且不适用于最新版本的Node

票数 2
EN

Stack Overflow用户

发布于 2022-09-13 22:30:54

您的package-lock.json无效。

根据this answer

你要做的第一件事是更新你的国家预防机制:

代码语言:javascript
运行
复制
npm install -g npm@8.19.1 to update

之后,删除package-lock.json & node_modules文件夹。

接下来,使用

代码语言:javascript
运行
复制
npm cache clean --force

并重新安装依赖项。

代码语言:javascript
运行
复制
npm install

您应该能够运行npm run dev

票数 2
EN

Stack Overflow用户

发布于 2022-09-26 23:53:43

此错误意味着,某些包查找依赖项的某些版本,但该依赖项已用以前的包请求的不同版本声明,它防止了许多缺陷,例如一些包使用过高版本的依赖项,并处理降级或主要不兼容问题。所以Npm是在保护你不受痛苦工作的伤害。

但无论发生什么事,你都可以指示npm安装任何东西。非常不建议:

代码语言:javascript
运行
复制
npm install --force

它将安装所有的依赖项,但是没有关于所有依赖项的保证,它们的依赖项的版本是正确的。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73705232

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档