3

I am doing a small Sinatra project and I want to use Gulp.

I have node(v0.12.0), npm(2.13.1), gulp(3.9.0) installed. I am in my project directory but when I try install a package like "npm install gulp-sass --save-dev", it doesn't create any "node_modules" folder in my project directory. It seems to be installing the package in my user home directory. Anything I am doing wrong?

2
  • From where are you calling npm install? The project directory? Commented Aug 22, 2015 at 16:19
  • Yeah from project directory "/Users/polarcare/Documents/Sites/somebs" Commented Aug 22, 2015 at 16:29

1 Answer 1

5

From the npm documentation:

Starting at the $PWD, npm will walk up the folder tree checking for a folder that contains either a package.json file, or a node_modules folder. If such a thing is found, then that is treated as the effective "current directory" for the purpose of running npm commands. (This behavior is inspired by and similar to git's .git-folder seeking logic when running git commands in a working dir.)

If no package root is found, then the current folder is used.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks. I created an empty "node_modules" folder and then ran "npm install gulp-sass --save-dev" and it installed it in the empty "node_modules" directory. I did a gulp tutorial a few months back when testing it out and I didn't need to manually create the node_modules folder, anyway thanks again!
This question has good answer in following link.link

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.