Reputation: 729
I ran into an issue today mid-class. I was showing my class how to install and use gulp.js, so I had to show the process on a projector.
I've installed node.js and gulp.js globally with npm install -g gulp
and it all works fine.
But when I try to install gulp locally in the project folder I am working on, it looks like gulp is installed, but the node_modules folder is never created.
I tried refreshing, I tried running the command prompt as admin, I've checked for hidden folders, nothing works. --- I even restarted and tried again, cause Windows.
I am working on windows 10.
Transcript of command line output:
C:\Xampp\htdocs\test> node -v
v4.2.4
C:\Xampp\htdocs\test> npm -v
2.14.12
C:\Xampp\htdocs\test> gulp -v
[16:40:28] CLI version 3.9.1
[16:40:28] Local version 3.9.1
C:\Xampp\htdocs\test> npm install --save-dev gulp
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
[email protected] ..\..\..\node_modules\gulp
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
Note: npm is in my PATH.
Upvotes: 4
Views: 1007
Reputation: 17579
You need either package.json
or folder named node_modules
in the current directory. If you are not going to have one, npm
will look for either one in the parent directories. Check answer to NPM Installs Package Outside Current Directory for more details.
Also it is advised to start with npm init
which will create package.json
for you.
Upvotes: 2