npm install is missing modules

前端 未结 6 1668
广开言路
广开言路 2021-02-04 01:53

Before I can run gulp in my project I need to run npm install. This works except on my computer, because I get the following error:

Err         


        
相关标签:
6条回答
  • 2021-02-04 02:21

    It seems that gulp need 'karma' dependencies (socket.io ,di ,log4js...) so you will have to run :

    npm install karma

    so just runing this command solved the problem, and all should be good, the same thing happens with grunt as well for some reasons.

    0 讨论(0)
  • 2021-02-04 02:21

    This worked for me. By commenting 3 lines in C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js.

    Refer [https://flaviocopes.com/cb-apply-not-a-function/]

    // fs.stat = statFix(fs.stat) # Line: 61
    // fs.fstat = statFix(fs.fstat) # Line: 62
    // fs.lstat = statFix(fs.lstat) # Line: 63
    
    0 讨论(0)
  • 2021-02-04 02:30

    To resolve missing npm modules run:

    sudo npm install -g npm-install-missing
    
    0 讨论(0)
  • 2021-02-04 02:31

    I am using the same version of npm/node. Sometimes, it is like npm is "lost". What I suggest is :

    • rm of your node modules (at least the one that is concerned)
    • npm cache clean
    • run "npm install" several times, until all dependencies are resolved and no message are displayed
    0 讨论(0)
  • 2021-02-04 02:35

    I've faced the same problem when bootstrapping a MEAN application and add each missing dependencie with npm install packageName --save was not an option so I came across to npm-install-missing whom has saved my life :)

    Installation

    npm install -g npm-install-missing

    Usage

    npm-install-missing
    
    0 讨论(0)
  • 2021-02-04 02:39

    Running npm install will install all dependencies that are specified in the package.json. Seems like you have quite a few dependencies that are not defined that way. Use npm install packageName --save and npm will add the package to your package.json.

    0 讨论(0)
提交回复
热议问题