The best way to run npm install for nested folders?

前端 未结 9 1842
北恋
北恋 2020-11-30 17:38

What is the most correct way to install npm packages in nested sub folders?

my-app
  /my-sub-module
  package.json
package.json
<
9条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-30 18:22

    I prefer using post-install, if you know the names of the nested subdir. In package.json:

    "scripts": {
      "postinstall": "cd nested_dir && npm install",
      ...
    }
    

提交回复
热议问题