How to get node packages up-to-date?

余生颓废 提交于 2021-01-29 12:50:44

问题


I've used a truffle react box to get an app working. npm install gives me lots of deprecation warnings, and alos that some packages need others that aren't installed. Is there a good way, or a place online, that can get my package.json file up to date? Since I'm really new to react, I think having missing packages is sure to cause a lot of lost time. Thank you.

package.json

{
  "name": "someApp",
  "version": "0.1.0",
  "license": "MIT",
  "private": true,
  "repository": {
    "type": "git",
    "url": "some repo..."
  },
  "main": "src/index.js",
  "scripts": {
    "start": "node scripts/start.js",
    "build": "node scripts/build.js",
    "test": "node scripts/test.js --env=jsdom --watch"
  },
  "dependencies": {
    "dotenv": "^2.0.0",
    "react": "^15.4.2",
    "react-dom": "^15.4.2",
    "react-router-dom": "^4.3.1"
  },
  "devDependencies": {
    "autoprefixer": "6.5.1",
    "babel-core": "6.17.0",
    "babel-eslint": "7.1.1",
    "babel-jest": "17.0.2",
    "babel-loader": "6.2.7",
    "babel-preset-react-app": "^2.0.1",
    "case-sensitive-paths-webpack-plugin": "1.1.4",
    "chalk": "1.1.3",
    "connect-history-api-fallback": "1.3.0",
    "cross-spawn": "4.0.2",
    "css-loader": "0.26.0",
    "debug": "^3.1.0",
    "detect-port": "1.0.1",
    "eslint": "3.8.1",
    "eslint-config-react-app": "^0.5.0",
    "eslint-loader": "1.6.0",
    "eslint-plugin-flowtype": "2.21.0",
    "eslint-plugin-import": "^2.13.0",
    "eslint-plugin-jsx-a11y": "2.2.3",
    "eslint-plugin-react": "6.4.1",
    "extract-text-webpack-plugin": "1.0.1",
    "file-loader": "0.9.0",
    "filesize": "3.3.0",
    "fs-extra": "0.30.0",
    "growl": "^1.10.2",
    "gzip-size": "3.0.0",
    "html-webpack-plugin": "2.24.0",
    "http-proxy-middleware": "0.17.2",
    "jest": "19.0.1",
    "json-loader": "0.5.4",
    "minimatch": "^3.0.2",
    "object-assign": "4.1.0",
    "openzeppelin-solidity": "1.11.0",
    "path-exists": "2.1.0",
    "postcss-loader": "1.0.0",
    "promise": "7.1.1",
    "react-dev-utils": "^0.4.2",
    "recursive-readdir": "2.1.0",
    "stmux": "^1.5.5",
    "strip-ansi": "3.0.1",
    "style-loader": "0.13.1",
    "truffle": "^4.1.13",
    "truffle-contract": "^1.1.8",
    "truffle-hdwallet-provider": "0.0.6",
    "truffle-solidity-loader": "0.0.8",
    "url-loader": "^1.0.1",
    "webpack": "^1.14.0",
    "webpack-dev-server": "^1.16.2",
    "webpack-manifest-plugin": "^1.1.0",
    "whatwg-fetch": "^1.0.0"
  },
  "jest": {
    "collectCoverageFrom": [
      "src/**/*.{js,jsx}"
    ],
    "setupFiles": [
      "<rootDir>/config/polyfills.js"
    ],
    "testMatch": [
      "<rootDir>/src/**/__tests__/**/*.js?(x)",
      "<rootDir>/coverage/**/?(*.)(spec|test).js?(x)"
    ],
    "testEnvironment": "node",
    "testURL": "http://127.0.0.1:7200",
    "transform": {
      "^.+\\.(js|jsx)$": "<rootDir>/node_modules/babel-jest",
      "^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
      "^(?!.*\\.(js|jsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
    },
    "transformIgnorePatterns": [
      "[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$"
    ],
    "moduleNameMapper": {
      "^react-native$": "react-native-web"
    },
    "moduleFileExtensions": [
      "web.js",
      "js",
      "json",
      "web.jsx",
      "jsx"
    ]
  },
  "babel": {
    "presets": [
      "react-app"
    ]
  },
  "eslintConfig": {
    "extends": "react-app"
  }
}

回答1:


A really cool package i've used is npm-check It provides a nice interface to tell you what packages are outdated. interface image

to install the package, run in your terminal: npm install -g npm-check To check packages, run: npm-check in the directory that contains the package.json you are checking.



来源:https://stackoverflow.com/questions/51846801/how-to-get-node-packages-up-to-date

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!