One of our products at work is a JS SDK that our clients can install and use with npm install...
. I was going through the package.json
file and found that a package, socket.io-client
was installed as a devDependency
. But the SDK is using socket.io
for an integral part of its working, and it obviously it's working for our clients. So, why is it working? Since, going by the documentation, devDependencies
should not be installed when using npm install
.
I figured out what's happening here. So when you do npm install
, npm will install all the dependencies, both devDependencies and regular dependencies. If you don't want to install devDependencies, use the --production
flag with npm install
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.