Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NPM not creating .bin directory

Tags:

node.js

npm

macos

I'm using npm v1.4.4 and node v0.10.25 on Mac OS X 10.9.2.

I've recently upgraded node and npm, and now npm install is no longer creating the .bin directory in node_modules.

I've deleted node_modules, tried npm install again, but the directory and binaries are never created.

Does anybody have any ideas as to why this is happening?

Here is my package.json:

{   "name": "redacted",   "author": {},   "description": "redacted",   "dependencies": {   },   "devDependencies": {     "karma": "*",     "karma-coverage": "0.1.2",     "karma-junit-reporter": "*",     "karma-coffee-preprocessor": "~0.1",     "grunt": "^0.4.2",     "grunt-contrib-requirejs": "^0.4.3",     "grunt-contrib-concat": "^0.3.0",     "grunt-contrib-sass": "^0.7.2",     "grunt-contrib-htmlmin": "^0.2.0",     "grunt-contrib-cssmin": "^0.7.0",     "grunt-contrib-coffee": "^0.10.1",     "grunt-contrib-uglify": "^0.3.3",     "grunt-contrib-jst": "^0.5.1",     "grunt-contrib-qunit": "^0.4.0",     "grunt-contrib-jshint": "^0.8.0",     "grunt-contrib-watch": "^0.5.3",     "grunt-contrib-jasmine": "^0.6.1",     "grunt-contrib-compress": "^0.6.1",     "grunt-contrib-handlebars": "^0.6.1",     "grunt-contrib-less": "^0.9.0",     "grunt-contrib": "^0.9.0"   } } 
like image 855
Gaz Avatar asked Mar 12 '14 06:03

Gaz


People also ask

What is npm bin?

The command npm bin lets you find out where the closest executables are: $ npm bin /tmp/node_modules/.bin.

What is node_modules .bin folder?

The directory node_modules/.bin is where the binaries of the modules used by your project are stored, normally using symbolic links to the respective binaries in the corresponding module's directory.

Does npm install create node_modules folder?

npm install doesn't create node_modules directory.

What is D flag in npm install?

The -D flag is the shortcut for: --save-dev . Source: https://docs.npmjs.com/cli/install. -D, --save-dev: Package will appear in your devDependencies. Follow this answer to receive notifications.


2 Answers

I know this is an old post but I experienced the same issue recently. I had copied files from an existing project including package.json and package-lock.json. The package-lock.json was what prevented the node_module/.bin directory from being created. The solution was to delete the node_modules directory and package-lock.json and run npm install again

like image 96
Balocodes Avatar answered Sep 17 '22 11:09

Balocodes


Seems that all your dependencies are dev dependencies. Could you see if your NODE_ENV environment variable is set to production now? If yes you will need to change it back.

Also, any error happened during installation?

like image 36
saladinxu Avatar answered Sep 20 '22 11:09

saladinxu