How to install only “devDependencies” using npm

后端 未结 4 1543
耶瑟儿~
耶瑟儿~ 2021-01-30 05:07

I am trying to install ONLY the \"devDependencies\" listed in my package.json file. But none of the following commands work as I expect. All of the following commands install th

4条回答
  •  走了就别回头了
    2021-01-30 05:17

    Check the NPM docs for install:

    With the --production flag (or when the NODE_ENV environment variable is set to production), npm will not install modules listed in devDependencies.

    The --only={prod[uction]|dev[elopment]} argument will cause either only devDependencies or only non-devDependencies to be installed regardless of the NODE_ENV.

    Have you tried the following?

    npm install --only=dev
    

提交回复
热议问题