简体   繁体   中英

How to Execute every package.json in the node.js project

I have multi module project structure in node.js. Main project has one package.json and inner modules have there own package.json. I have to execute the main package.json with inner ones. How should i tell main package.json to execute others.

By using local paths: https://docs.npmjs.com/files/package.json#local-paths

{
  "name": "Main module",
  "dependencies": {
    "sub-module-1": "file:./my/local/path"
  }
}

Specify all of your submodules in the dependencies section of your main package.json and then run your regular npm commands ( npm install , etc.)

I had the same issue. I solved it by writing a shell script.

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.

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