How to deploy Node.js application with deep node_modules structure on Windows?

前端 未结 8 1210
北荒
北荒 2020-11-30 17:11

I\'ve run into a curious issue - apparently some Node.js module have so deep folder hierarchies that Windows copy command (or PowerShell\'s C

8条回答
  •  悲哀的现实
    2020-11-30 18:09

    I found one solution from Microsoft Node.js Guidelines.

    • Start in a short path (e.g. c:\src)
    • > npm install -g rimraf delete files that exceed max_path
    • > npm dedupe moves duplicate packages to top-level
    • > npm install -g flatten-packages moves all packages to top-level, but can cause versioning issues
    • Upgrade to npm@3 which attempts to the make the node_modules folder heirarchy maximally flat.
      • Ships with Node v5
      • Or… > npm install –g npm-windows-upgrade

提交回复
热议问题