Will the dependencies in package.json be installed automatically after npm install?

for example, I have a vue project in A. I want to install all the plug-ins that have been installed in Project An in the new Project B. can I just copy the package.json of Project An and execute npm install directly in the B directory? But I gave it a try. When I ran Project B, I was reminded that many plug-ins were not installed. What"s going on? Or is it that package.json can"t implement the function I"m talking about?


I also introduced them into main.js

import Vue from "vue"
import App from "./App"
import router from "./router/index"
import axios from "axios"
import store from "./store/store"
import ElementUI from "element-ui"
import Mint from "mint-ui"
import "mint-ui/lib/style.css"
import "element-ui/lib/theme-chalk/index.css"
// eslint-disable-next-line no-unused-vars
import $ from "jquery"
import "bootstrap/dist/css/bootstrap.min.css"
import "bootstrap/dist/js/bootstrap.min"
import Mui from "vue-awesome-mui"
Vue.use(Mui)

window.$ = window.jQuery = $
Vue.use(ElementUI)
Vue.use(Mint)
Vue.prototype.$http = axios
// Vue.use(ElementUI)
// Vue.prototype.$axios = axios
// axios.defaults.baseURL = "http://api.douban.com/v2/"
// axios.defaults.baseURL = "http://www.weather.com.cn/"
axios.defaults.headers.post["Content-Type"] = "application/json"

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: "-sharpapp",
  router,
  store,
  components: { App },
  template: "<App/>"
})

package.json Code

{
  "name": "blog",
  "version": "1.0.0",
  "description": "A Vue.js project",
  "author": "",
  "private": true,
  "scripts": {
    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
    "start": "npm run dev",
    "unit": "jest --config test/unit/jest.conf.js --coverage",
    "e2e": "node test/e2e/runner.js",
    "test": "npm run unit && npm run e2e",
    "lint": "eslint --ext .js,.vue src test/unit test/e2e/specs",
    "build": "node build/build.js"
  },
  "dependencies": {
    "axios": "^0.18.0",
    "element-ui": "^2.4.8",
    "mint-ui": "^2.2.13",
    "popper.js": "^1.14.4",
    "vue": "^2.5.2",
    "vue-awesome-mui": "^1.7.3",
    "vue-router": "^3.0.1"
  },
  "devDependencies": {
    "autoprefixer": "^7.1.2",
    "babel-core": "^6.22.1",
    "babel-eslint": "^8.2.1",
    "babel-helper-vue-jsx-merge-props": "^2.0.3",
    "babel-jest": "^21.0.2",
    "babel-loader": "^7.1.1",
    "babel-plugin-component": "^1.1.1",
    "babel-plugin-dynamic-import-node": "^1.2.0",
    "babel-plugin-syntax-jsx": "^6.18.0",
    "babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
    "babel-plugin-transform-object-rest-spread": "^6.26.0",
    "babel-plugin-transform-runtime": "^6.22.0",
    "babel-plugin-transform-vue-jsx": "^3.5.0",
    "babel-preset-env": "^1.3.2",
    "babel-preset-stage-2": "^6.22.0",
    "babel-register": "^6.22.0",
    "bootstrap": "^4.1.3",
    "chalk": "^2.0.1",
    "chromedriver": "^2.27.2",
    "copy-webpack-plugin": "^4.0.1",
    "cross-spawn": "^5.0.1",
    "css-loader": "^0.28.0",
    "eslint": "^4.15.0",
    "eslint-config-standard": "^10.2.1",
    "eslint-friendly-formatter": "^3.0.0",
    "eslint-loader": "^1.7.1",
    "eslint-plugin-import": "^2.7.0",
    "eslint-plugin-node": "^5.2.0",
    "eslint-plugin-promise": "^3.4.0",
    "eslint-plugin-standard": "^3.0.1",
    "eslint-plugin-vue": "^4.0.0",
    "extract-text-webpack-plugin": "^3.0.0",
    "file-loader": "^1.1.4",
    "friendly-errors-webpack-plugin": "^1.6.1",
    "html-webpack-plugin": "^2.30.1",
    "jest": "^22.0.4",
    "jest-serializer-vue": "^0.3.0",
    "jquery": "^3.3.1",
    "nightwatch": "^0.9.12",
    "node-notifier": "^5.1.2",
    "optimize-css-assets-webpack-plugin": "^3.2.0",
    "ora": "^1.2.0",
    "portfinder": "^1.0.13",
    "postcss-import": "^11.0.0",
    "postcss-loader": "^2.0.8",
    "postcss-url": "^7.2.1",
    "rimraf": "^2.6.0",
    "selenium-server": "^3.0.1",
    "semver": "^5.3.0",
    "shelljs": "^0.7.6",
    "uglifyjs-webpack-plugin": "^1.1.1",
    "url-loader": "^0.5.8",
    "vue-jest": "^1.0.2",
    "vue-loader": "^13.3.0",
    "vue-style-loader": "^3.0.1",
    "vue-template-compiler": "^2.5.2",
    "vuex": "^3.0.1",
    "webpack": "^3.6.0",
    "webpack-bundle-analyzer": "^2.9.0",
    "webpack-dev-server": "^2.9.1",
    "webpack-merge": "^4.1.0"
  },
  "engines": {
    "node": ">= 6.0.0",
    "npm": ">= 3.0.0"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
  ]
}
Npm
Feb.22,2022

works in theory, but make sure you've installed it all successfully.


this is not installed, but not introduced. You can find the main.js file and introduce the main.js file dependency in Project A.


check to see if there is any bootstrap element-ui in package.json. If not, you forgot-- save when you installed Project A. If so, your npm install failed

.
Menu