I have been struggling to install bcrypt all weekend. Over the course of the weekend I have updated Node to version 10.15.3 (and npm 6.4.1).
A possible solution is to forget about bcrypt and install bcryptjs. My (perhaps unfounded?) concern is that the latest version (2.4.3) of bcryptjs is 2 years old whereas bcrypt has the benefit of continuous support. I would like to use bcrypt in my project.
Here is the error I got:
vagrant [server]> npm install bcrypt
npm WARN server@1.0.0 No description
npm WARN server@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! path /vagrant/barbershop-pevn/server/node_modules/bcrypt/node_modules/minipass/node_modules/yallist/package.json.3160920247
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/vagrant/barbershop-pevn/server/node_modules/bcrypt/node_modules/minipass/node_modules/yallist/package.json.3160920247'
On the server folder...
package.json
{
"name": "server",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "./node_modules/nodemon/bin/nodemon.js src/app.js --exec 'npm run lint && node'",
"lint": "./node_modules/.bin/eslint \"**/*.js\""
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.18.3",
"cors": "^2.8.5",
"dotenv": "^7.0.0",
"express": "^4.16.4",
"joi": "^14.3.1",
"jsonwebtoken": "^8.5.0",
"morgan": "^1.9.1",
"pg": "^7.9.0",
"pg-hstore": "^2.3.2",
"semver": "^5.6.0",
"sequelize": "^5.1.0"
},
"devDependencies": {
"eslint": "^5.15.3",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-vue": "^5.2.2",
"nodemon": "^1.18.10"
}
}
npm list -g --depth=0
returns:
/home/vagrant/.nvm/versions/node/v10.15.3/lib
├── @vue/cli@3.5.0
├── @vue/cli-init@3.5.0
├── http-server@0.11.1
├── node-gyp@3.8.0
├── npm@6.4.1
├── npm-check@5.9.0
└── npx@10.2.0
cat /etc/*release
returns:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"
NAME="Ubuntu"
VERSION="16.04.6 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.6 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
OS of my mac: 10.13.6
MAJOR EDIT 1:
I did the following:
vagrant [server]> sudo apt install node-gyp
And then I got this error:
vagrant [server]> npm install bcrypt
npm WARN server@1.0.0 No description
npm WARN server@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! path /vagrant/barbershop-pevn/server/node_modules/bcrypt/node_modules/minipass/node_modules/safe-buffer/package.json.3118274111
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/vagrant/barbershop-pevn/server/node_modules/bcrypt/node_modules/minipass/node_modules/safe-buffer/package.json.3118274111'
What am I missing? Any help that allows for the installation of bcrypt or at least points me in the right direction is greatly appreciated.