search

Home  >  Q&A  >  body text

javascript - A problem about the failure of npm to install dependencies. It flashed for a while.

It flashed when installing dependencies. What is the problem?
Dependencies were not installed successfully

package.json

{
  "name": "test",
  "version": "1.0.0",
  "description": "1",
  "main": "index.js",
  "private": true,
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "webpack-dev-server"
  },  "author": "",
  "license": "ISC",
  "devDependencies": {
    "angular": "^1.4.14",
    "angular-route": "^1.6.4",
    "babel-core": "^6.24.1",
    "babel-loader": "^7.0.0",
    "babel-preset-es2015": "^6.24.1",
    "css-loader": "^0.28.0",
    "node-sass": "^4.5.2",
    "sass-loader": "^6.0.3",
    "style-loader": "^0.16.1",
    "webpack": "^2.4.1",
    "webpack-dev-server": "^2.4.4"
  }
}
漂亮男人漂亮男人2750 days ago652

reply all(5)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-05-16 13:27:07

    Because your package.json only has devDependencies but no dependencies, and you have configured npm install to only install dependencies, so the installation failed after a flash.

    1. Check whether NODE_ENV=production is configured, modify it and then install it.

    2. Or execute NODE_ENV=development npm i

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-16 13:27:07

    Is it normal to run other npm operations separately in cmd? What about changing the folder and dependent files? What about using administrator rights?

    reply
    0
  • 怪我咯

    怪我咯2017-05-16 13:27:07

    This should be something similar to @echo on
    That is to say, what exactly is done during installation will be displayed.
    You can try
    npm set progress=falsenpm set progress=false
    然后再
    npm installand then
    npm install
    This should stop the flashing.
    The reason why it flashes is that you installed relatively few dependencies and did not close the installation progress.

    But it is not recommended to do this. Displaying the installation details can let us know more clearly what the program has done. 🎜

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-16 13:27:07

    "author": "", change the line. Is it good to install npm packages separately? Is npm installed?

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-16 13:27:07

    Need to change to development?

    reply
    0
  • Cancelreply