【问题标题】:npm does not support Node.js v8.17.0npm 不支持 Node.js v8.17.0
【发布时间】:2021-11-11 20:59:46
【问题描述】:

所以我面临的问题是我的package.json 文件中的某些包需要node 版本大于10。所以我安装了nvm 软件包来管理node 版本,当我这样做时node -v 它给了我这个:v12.19.0。所以如果节点版本是12.19.0,那么错误不应该出现,但我认为这是节点的全局版本,所以当我更新npm 时,会出现:

npm WARN npm npm does not support Node.js v8.17.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN EBADENGINE Unsupported engine { package: 'gulp-imagemin@7.1.0',
npm WARN EBADENGINE   required: { node: '>=10' },
npm WARN EBADENGINE   current: { node: 'v8.17.0', npm: '7.5.4' } }
npm WARN EBADENGINE Unsupported engine { package: 'imagemin-gifsicle@7.0.0',
npm WARN EBADENGINE   required: { node: '>=10' },
npm WARN EBADENGINE   current: { node: 'v8.17.0', npm: '7.5.4' } }
npm WARN EBADENGINE Unsupported engine { package: 'imagemin-jpegtran@7.0.0',
npm WARN EBADENGINE   required: { node: '>=10' },
npm WARN EBADENGINE   current: { node: 'v8.17.0', npm: '7.5.4' } }
npm WARN EBADENGINE Unsupported engine { package: 'imagemin-optipng@8.0.0',
npm WARN EBADENGINE   required: { node: '>=10' },
npm WARN EBADENGINE   current: { node: 'v8.17.0', npm: '7.5.4' } }
npm WARN EBADENGINE Unsupported engine { package: 'imagemin-pngquant@9.0.1',
npm WARN EBADENGINE   required: { node: '>=10' },
npm WARN EBADENGINE   current: { node: 'v8.17.0', npm: '7.5.4' } }
npm WARN EBADENGINE Unsupported engine { package: 'imagemin-svgo@8.0.0',
npm WARN EBADENGINE   required: { node: '>=10' },
npm WARN EBADENGINE   current: { node: 'v8.17.0', npm: '7.5.4' } }
npm WARN EBADENGINE Unsupported engine { package: 'yargs@16.2.0',
npm WARN EBADENGINE   required: { node: '>=10' },
npm WARN EBADENGINE   current: { node: 'v8.17.0', npm: '7.5.4' } }
npm WARN EBADENGINE Unsupported engine { package: 'gifsicle@5.1.0',
npm WARN EBADENGINE   required: { node: '>=10' },
npm WARN EBADENGINE   current: { node: 'v8.17.0', npm: '7.5.4' } }
npm WARN EBADENGINE Unsupported engine { package: 'execa@4.1.0',
npm WARN EBADENGINE   required: { node: '>=10' },
npm WARN EBADENGINE   current: { node: 'v8.17.0', npm: '7.5.4' } }
npm WARN EBADENGINE Unsupported engine { package: 'jpegtran-bin@5.0.2',
npm WARN EBADENGINE   required: { node: '>=10' },
npm WARN EBADENGINE   current: { node: 'v8.17.0', npm: '7.5.4' } }
npm WARN EBADENGINE Unsupported engine { package: 'optipng-bin@7.0.0',
npm WARN EBADENGINE   required: { node: '>=10' },
npm WARN EBADENGINE   current: { node: 'v8.17.0', npm: '7.5.4' } }
npm WARN EBADENGINE Unsupported engine { package: 'execa@4.1.0',
npm WARN EBADENGINE   required: { node: '>=10' },
npm WARN EBADENGINE   current: { node: 'v8.17.0', npm: '7.5.4' } }
npm WARN EBADENGINE Unsupported engine { package: 'ow@0.17.0',
npm WARN EBADENGINE   required: { node: '>=10' },
npm WARN EBADENGINE   current: { node: 'v8.17.0', npm: '7.5.4' } }
npm WARN EBADENGINE Unsupported engine { package: 'pngquant-bin@6.0.0',
npm WARN EBADENGINE   required: { node: '>=10' },
npm WARN EBADENGINE   current: { node: 'v8.17.0', npm: '7.5.4' } }
npm WARN EBADENGINE Unsupported engine { package: 'execa@4.1.0',
npm WARN EBADENGINE   required: { node: '>=10' },
npm WARN EBADENGINE   current: { node: 'v8.17.0', npm: '7.5.4' } }
npm WARN EBADENGINE Unsupported engine { package: 'y18n@5.0.5',
npm WARN EBADENGINE   required: { node: '>=10' },
npm WARN EBADENGINE   current: { node: 'v8.17.0', npm: '7.5.4' } }
npm WARN EBADENGINE Unsupported engine { package: 'yargs-parser@20.2.6',
npm WARN EBADENGINE   required: { node: '>=10' },
npm WARN EBADENGINE   current: { node: 'v8.17.0', npm: '7.5.4' } }
npm WARN EBADENGINE Unsupported engine { package: 'wrap-ansi@7.0.0',
npm WARN EBADENGINE   required: { node: '>=10' },
npm WARN EBADENGINE   current: { node: 'v8.17.0', npm: '7.5.4' } }
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)

added 165 packages, removed 190 packages, changed 69 packages, and audited 1485 packages in 2m

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

5 vulnerabilities (4 low, 1 high)

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

Run `npm audit` for details.

出于某种原因,该应用使用的版本是 8.17.0。我想将它更新到大于 10。我该怎么做?

我在Ubuntu 20.04

编辑

这是我的package.json 文件:

{
    "name": "stash",
    "description": "Wordpress stack",
    "main": "index.js",
    "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
    },
    "repository": {
        "type": "git",
        "url": "git@gitlab.com:undefinedio/stash.git"
    },
    "author": "Vincent Peters",
    "devDependencies": {
        "babel-polyfill": "^6.23.0",
        "babel-preset-es2015": "^6.24.1",
        "babelify": "^7.3.0",
        "browser-sync": "^2.26.14",
        "browserify": "^14.4.0",
        "buffer": "^5.0.6",
        "dotenv": "^4.0.0",
        "gulp": "^4.0.2",
        "gulp-autoprefixer": "^4.0.0",
        "gulp-clean-css": "^3.7.0",
        "gulp-composer": "^0.4.0",
        "gulp-concat": "^2.6.1",
        "gulp-consolidate": "^0.2.0",
        "gulp-debug": "^3.1.0",
        "gulp-filter": "^5.0.0",
        "gulp-header": "^1.8.9",
        "gulp-iconfont": "^10.0.3",
        "gulp-if": "^2.0.2",
        "gulp-imagemin": "^7.1.0",
        "gulp-load-plugins": "^1.5.0",
        "gulp-notify": "^3.0.0",
        "gulp-plumber": "^1.1.0",
        "gulp-sass": "^3.1.0",
        "gulp-sourcemaps": "^2.6.0",
        "gulp-streamify": "^1.0.2",
        "gulp-uglify": "^3.0.0",
        "gulp-util": "^3.0.8",
        "gulp-watch": "^5.0.1",
        "imagemin-gifsicle": "^7.0.0",
        "imagemin-jpegtran": "^7.0.0",
        "imagemin-optipng": "^8.0.0",
        "imagemin-pngquant": "^9.0.1",
        "imagemin-svgo": "^8.0.0",
        "main-bower-files": "^2.13.1",
        "merge-stream": "^1.0.1",
        "node-bourbon": "^4.2.8",
        "node-neat": "^2.0.0-beta.0",
        "susy": "^2",
        "vinyl-buffer": "^1.0.0",
        "vinyl-source-stream": "^1.1.0",
        "yargs": "^16.2.0"
    },
    "dependencies": {
        "flickity": "^2.2.2",
        "flickity-imagesloaded": "^2.0.0",
        "gsap": "^1.20.2",
        "lazysizes": "^5.3.0",
        "scrollmagic": "^2.0.5",
        "viewport-units-buggyfill": "^0.6.2"
    }
}    },
    "dependencies": {
        "flickity": "^2.2.2",
        "flickity-imagesloaded": "^2.0.0",
        "gsap": "^1.20.2",
        "lazysizes": "^5.3.0",
        "scrollmagic": "^2.0.5",
        "viewport-units-buggyfill": "^0.6.2"
    }
}

【问题讨论】:

    标签: node.js


    【解决方案1】:

    当前安装的 npm 好像与新节点不兼容。

    已发布解决方案here:

    解决方案是卸载 npm,然后重新安装 node,该 node 将包含正确版本的 npm。

    方法如下:

    1. 卸载 npm。

      苹果: sudo npm 卸载 -g npm

      窗户: npm 卸载 -g npm

    2. https://nodejs.org安装节点

    【讨论】:

      【解决方案2】:

      我认为问题出在您的 package.json 上,只需运行 npm install 即可。

      【讨论】:

      • 你能添加你的 package.json 文件吗?
      • 试试 npm install npm@latest -g
      • 添加包,json
      猜你喜欢
      • 2021-04-09
      • 1970-01-01
      • 2018-04-23
      • 1970-01-01
      • 2020-11-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-10
      相关资源
      最近更新 更多