简体   繁体   English

package.json 中依赖部分中的“npm:”前缀是什么意思?

[英]What does "npm:" prefix in dependency section in package.json mean?

I am wondering what does that mean:我想知道这是什么意思:

"dependencies": {
    "@mui/styled-engine": "npm:@mui/styled-engine-sc@5.3.0",
}

What is that npm: prefix? npm:前缀是什么?

Probably telling npm where to get the package from (in this case npm): https://docs.npmjs.com/cli/v8/configuring-npm/package-json#dependencies可能告诉 npm 从哪里获取 package(在本例中为 npm): https://docs.npmjs.com/cli/v8/configuring-npm/package-json#dependencies

There's also file: and git: as you can see.还有file:git:如您所见。

I've used this code for many times:我已经多次使用此代码:

"dependencies": {
    "node-sass": "npm:sass@x.y.z",
}

It makes npm download sass instead of node-sass.它使 npm 下载 sass 而不是 node-sass。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM