npm installs all modules in /usr/local/lib/node_modules/

前端 未结 3 2008
Happy的楠姐
Happy的楠姐 2020-12-31 13:33

I have node.js 0.8.14 installed on Ubuntu 12.10. I created a directory in my home directory with a sub directory node_modules. I want to install some local node

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-31 13:56

    npm install load all in node_modules then it might be version 3 behaviour http://blog.npmjs.org/post/110924823920/npm-weekly-5 or as mentioned by @vsdev so once you make sure it version 3 behaviour and u want to go with it then its fine else follow below

    1- uninstall all modules.. into the node_modules folder in your project then execute: npm uninstall *

    2- Tell npm to install with legacy bundling for this one install:

    npm install --legacy-bundling A "permanent" alternative:

    Set your npm config to always use legacy bundling...

    npm set legacy-bundling=true

    .. and run as usual:

    npm install

    *fetching dependencies with legacy bundling will take a lot more time because many several different versions of the same dependencies will be installed.

提交回复
热议问题