NPM doesn't install module dependencies

前端 未结 16 1766
深忆病人
深忆病人 2020-12-02 06:39

This is my package.json for the module that I\'m including in the parent project:

{
  \"version\": \"0.0.1\",
  \"name\": \"module-name\",
  \"d         


        
相关标签:
16条回答
  • 2020-12-02 07:04

    You might need to install the grunt-cli, try this before doing a npm install:

    sudo npm install -g grunt-cli
    

    That fixes the grunt does not exit for me, you'll also need a valid grunt file.

    Source: https://stackoverflow.com/a/16456467/241294

    0 讨论(0)
  • 2020-12-02 07:05

    I think that I also faced this problem, and the best solution I found was to look at my console and figure out the error that was being thrown. So, I read it carefully and found that the problem was that I didn't specify my repo, description, and valid name in my package.json. I added those pieces of information and everything was okay.

    0 讨论(0)
  • 2020-12-02 07:08

    It looks like you hit a bug that has existed for quite a while and doesn't have solution yet. There are several open issues for this case in the npm repository:

    • npm install should recursively check/install dependencies https://github.com/npm/npm/issues/1341 (closed)
    • local private module dependencies https://github.com/npm/npm/issues/2442 (closed)

    In the first one people list several workarounds that you may try.

    An alternative solution may be (a little hackish) to explicitly list the dependencies as first level dependents. This requires you to maintain the list but practically it has to be done very infrequently.

    0 讨论(0)
  • 2020-12-02 07:08

    I am using windows machine.

    1. I deleted node_modules folder.
    2. Somehow, package.lock.json file is getting created. I deleted that file.
    3. Then npm install.
    4. Clean build.
    5. Run.
    0 讨论(0)
提交回复
热议问题