Automatic deployment of vue projects, v-deep does not take effect problem records

environment: 

view2.6.14

@vue/cli 5.0.4

Running locally (npm run dev) v-deep is effective, but the operation and maintenance editing script, the style of v-deep is invalid when it is automatically deployed to docker

The project uses sass preprocessing, while the cli uses dart-sass

"sass": "^1.34.1",
"sass-loader": "^8.0.2",

First confirm the node version and npm version

Local node and npm

irving@IrvingdeMacBook-Pro ~ % node -v
v14.19.1
irving@IrvingdeMacBook-Pro ~ % npm -v
6.14.16
irving@IrvingdeMacBook-Pro ~ % 

Node and npm versions on docker

node -v
v14.17.1
npm -v
6.14.13

Although there is a small difference between the two, they belong to the same large version, so there should be no problem.

Finally, compared the versions of sass-loader, vue, and vue-template-compiler, it was found that the versions of vue and vue-template-compiler were inconsistent. Because some colleagues use yarn and some use npm, there is no package-lock.json or yarn-lock.json.

So lock vue and vue-template-compiler versions in package.json

Original package.json corresponding code

dependencies: {
    ...
    "vue": "^2.6.14",
    ...
},
devDependencies: {
    ...
    "vue-template-compiler": "^2.6.14"
    ...
}

Remove the "^" 

dependencies: {
    ...
    "vue": "2.6.14",
    ...
},
devDependencies: {
    ...
    "vue-template-compiler": "2.6.14"
    ...
}

package.json Different ways of writing various dependencies in

"dependencies": {
    "vant": "1.4.0",
    "lodash": "*",
    "react": "16.x",
    "elemnet-ui": "~5.4.6",
    "vue": "^2.3.3"
  }
  • "vant": "1.4.0": fixed version number
  • "lodash": "*": Install the latest version of the dependency package ( >=0.0.0)
  • "react": "16.x": match major version ( >=16.0.0 <17.0.0)
  • "react": "16.3.x": match major and minor version ( >=16.3.0 <16.4.0)
  • ~: When a new version is obtained when installing dependencies,   the latest version is x.y.z installed  . zThat is, keep the major version number and minor version number unchanged, and keep the latest version of the revision number. For example, ~1.2.3 will match all 1.2.x versions, but excluding 1.3.0.
  • ^: When a new version is obtained during the installation of dependencies,   the latest version will be installed x.y.z in  y both  . zThat is, keep the minor version number and revision number as the latest version while keeping the major version number unchanged. For example, ^1.2.3 will match all 1.xx packages, including 1.3.0, but excluding 2.0.0.

Guess you like

Origin blog.csdn.net/qq_40441489/article/details/126279888