安装节点6后出错,npm ERR!无效版本:1.0.5beta

Error after installing Node 6, npm ERR! Invalid Version: 1.0.5beta

本文关键字:版本 无效 5beta ERR 节点 出错 npm 安装      更新时间:2023-09-26

我使用的是npm版本3.8.6。

我安装了最新的Nodejs版本,并做了这个

MacBook-Pro-de-MarceloRS:promo-mobile-ccsearchlp7a Marcelo$ rm -rf node_modules/; npm install
npm WARN deprecated gulp-foreach@0.1.0: Either use gulp-tap or gulp-flatmap, depending on your needs
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v6.0.0
npm ERR! npm  v3.8.6
npm ERR! Invalid Version: 1.0.5beta
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Marcelo/Documents/Projects/BankOfAmericaApps/promo-mobile-ccsearchlp7a/npm-debug.log
MacBook-Pro-de-MarceloRS:promo-mobile-ccsearchlp7a Marcelo$ npm -v
3.8.6

你认为这是为什么?

我正在使用OSX El Capitan。

编辑

这是我的包.json

{
  "name": "promo-mobile-ccsearchlp7a",
  "app": "app",
  "dist": "dist",
  "version": "2.0.0",
  "private": true,
  "dependencies": {
    "assemble": "~0.9.1",
    "browser-sync": "~2.11.1",
    "del": "~2.2.0",
    "engine-handlebars": "^0.8.0",
    "get-value": "~2.0.3",
    "gulp": "~3.9.1",
    "gulp-autoprefixer": "~3.1.0",
    "gulp-cssnano": "~2.1.1",
    "gulp-eslint": "~2.0.0",
    "gulp-extname": "~0.2.2",
    "gulp-filter": "~3.0.1",
    "gulp-flatten": "~0.2.0",
    "gulp-foreach": "~0.1.0",
    "gulp-imagemin": "~2.4.0",
    "gulp-load-plugins": "~1.2.0",
    "gulp-notify": "~2.2.0",
    "gulp-plumber": "~1.1.0",
    "gulp-sass": "~2.2.0",
    "gulp-sourcemaps": "~1.6.0",
    "gulp-uglify": "~1.5.2",
    "gulp-usemin": "~0.3.20",
    "gulp-util": "~3.0.7",
    "handlebars-helpers": "github:assemble/handlebars-helpers#dev",
    "main-bower-files": "~2.9.0",
    "multimatch": "~2.1.0",
    "run-sequence": "~1.1.5"
  },
  "engines": {
    "node": ">=0.12.2"
  },
  "devDependencies": {
    "git-guppy": "~1.1.0",
    "gulp-watch": "~4.3.5"
  },
  "scripts": {
    "postinstall": "bower install"
  }
}

矿井安装良好。但我注意到以下几点:

我安装在节点V5下。

您正在使用节点V6。

我收到了以下通知:

npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v6.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.

你需要更新你的package.json来获取lodash v4和优雅的fs v4

(对我来说,最简单的方法是从package.json和npm --save install package中删除这两行,重新安装这两行