oimou
oimou

Reputation: 21

npm installs modules into current directory, not only node_modules

I tried to create new project and did like this.

> express newproject

> cd newproject

> ls
app.js          package.json    public/         routes/         views/

> npm install

// ...

> ls
app.js                  commander/              cookie-signature/       formidable/             methods/                node_modules/           public/                 routes/
buffer-crc32/           connect/                debug/                  fresh/                  mime/                   package.json            qs/                     send/
bytes/                  cookie/                 express/                jade/                   mkdirp/                 pause/                  range-parser/           views/

Why the files are downloaded into current directory? Is this a bug?

Resolved

I resolved this issue by fixing ~/.npmrc.

- cache = .
+ cache = ~/.npm

It works!

Upvotes: 1

Views: 241

Answers (1)

oimou
oimou

Reputation: 21

Resolved

I resolved this issue by fixing ~/.npmrc.

- cache = .
+ cache = ~/.npm

It works!

Upvotes: 1

Related Questions