0

I have seen this issue here, but it's old, I tried everything and nothing helped me. I have a script that run just after vagrant finished to install Ubuntu 17.04. In that script I do a sudo npm install --no-bin-links to install the dependencies of the project cloned previously. This is the package.json :

{
  "name": "project",
  "version": "1.0.0",
  "description": "Just a project",
  "main": "server.js",
  "author": "author",
  "private": true,
  "license": "ISC",
  "dependencies": {
    "async": "^2.5.0",
    "bcrypt": "^1.0.3",
    "body-parser": "^1.17.2",
    "connect-redis": "^3.3.0",
    "cors": "^2.8.4",
    "dotenv": "^4.0.0",
    "express": "^4.15.2",
    "express-rate-limit": "^2.8.0",
    "express-session": "^1.15.4",
    "helmet": "^3.8.0",
    "marked": "^0.3.6",
    "multer": "^1.3.0",
    "mv": "^2.1.1",
    "mysql2": "^1.4.2",
    "request": "^2.82.0",
    "sequelize": "^4.13.2"
  },
  "devDependencies": {
    "chai": "^4.1.2",
    "chai-http": "^3.0.0",
    "mocha": "^4.0.1",
    "sequelize-cli": "^3.0.0"
  }
}

Everything works well except the dependencies that need a .bin folder, like mocha or sequelize-cli. When I go to my node_modules of my project, there is no .bin folder...

Does somebody know why?

I run :
Ubuntu 17.04
Node 8.7.0
NPM 5.4.2
And everything with Vagrant and Windows 10.

Louis Etienne
  • 1,302
  • 3
  • 20
  • 37
  • Did you try running the command without the `--no-bin-links`. Something like this: `sudo npm install` – codejockie Oct 20 '17 at 07:31
  • I have the symlink error, I can't use symlink if it's vagrant on top of windows :/ – Louis Etienne Oct 20 '17 at 07:46
  • I hope that I'm don't offend anyone, but did you try running `ls -a` if you're using Terminal or enabling hidden folders in your file manager? – Mr.J 01 Mar 18 '21 at 11:52

1 Answers1

1

You should install via sudo npm install. The --no-bin-links option will prevent npm from adding symlinks in .bin to the actual binaries in each installed package. AFAIK, and according to this SO question, this is only useful on systems without symlinks.

Horia Coman
  • 8,681
  • 2
  • 23
  • 25
  • Without I have the symlink error... Normaly if it's [vagrant on top of windows I can't use symlink](https://github.com/npm/npm/issues/9901) I have to write `--no-bin-links` – Louis Etienne Oct 20 '17 at 07:45
  • Do they not work even if you run them from their own packages? Like `./node_modules/mocha/bin/mocha`? @Wizix – Horia Coman Oct 20 '17 at 07:58
  • Yes it works. I found the problem, Windows needs thé administrator rights in order to create the symlinks. I just need to run vagrant up un administrator ! – Louis Etienne Oct 20 '17 at 08:35