Npm install locally

In the past, when I installed packages using npm (> = 1.0), they were installed locally, but no more.

My setup:

  • First I use nvm to install node.js.

  • My operating system:

    alfred@alfred-laptop:~/node/so/6513101$ cat /etc/lsb-release DISTRIB_ID=Ubuntu<br> DISTRIB_RELEASE=10.10 DISTRIB_CODENAME=maverick DISTRIB_DESCRIPTION="Ubuntu 10.10" 
  • My version of node:

     alfred@alfred-laptop:~/node/so/6513101$ node -v v0.4.8 
  • My npm version:

     alfred@alfred-laptop:~/node/so/6513101$ npm -v 1.0.15 

Install a random package

 alfred@alfred-laptop:~/node/so/6513101$ npm install notifo notifo@0.0.2 ../../../node_modules/notifo 

In the past, it was installed in the same directory, but it is no longer installed in the same directory. my npm / node.js is broken or I will skip something or npm no longer installs local packages (inside the same folder => ~/node/so/6513101/node_modules ), which I thought were cool because I all my dependencies could bundle so other users didn’t need to install npm to use my code (I still think users should install npm because it is a great product). The bundle command has disappeared, so I can’t use it? Can someone explain to me what is going on?

+21
Jun 29 2018-11-11T00:
source share
1 answer

npm raises the folder tree until it finds node_modules or package.json and uses it as the root. What does npm root print?

If you mkdir node_modules or create a package.json file, then it will use cwd.

EDIT: I will not see the updates you post here. For best results, just post everything on the github issue and let the support do there.

+55
Jun 29 2018-11-11T00:
source share



All Articles