'npm install bcrypt' fails on Ubuntu 17.04 64 bit - javascript

I am trying to install bcrypt as a node dependency:
https://www.npmjs.com/package/bcrypt
My environment:
Ubuntu 17.04, 64 bit
node v6.11.0
npm v4.2.0
I have followed the instructions for Ubuntu:
https://github.com/kelektiv/node.bcrypt.js/wiki/Installation-Instructions#ubuntu-and-derivatives---elementary-linux-mint-etc
The installation seems to hang on the node-pre-gyp build.
Stack trace:
$ npm install bcrypt
bcrypt#1.0.2 install /XXXXXX/node_modules/bcrypt
node-pre-gyp install --fallback-to-build
module.js:472
throw err;
^
Error: Cannot find module './internal/streams/stream'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/XXXXXXXX/node_modules/readable-stream/lib/_stream_readable.js:28:14)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 4.10.0-19-generic
npm ERR! argv "/XXXX/.nvm/versions/node/v7.10.0/bin/node" "/XXXX/.nvm/versions/node/v7.10.0/bin/npm" "install" "bcrypt"
npm ERR! node v6.11.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt#1.0.2 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
Interestingly, I can install node-pre-gyp with npm, but node-pre-gyp install --fallback-to-build still fails.
Any advice?

use bcrypt-nodejs module instead of bcrypt
`npm install bcrypt-nodejs`
then
var bcrypt = require('bcrypt-nodejs');

Solved in the GitHub issue thread:
https://github.com/kelektiv/node.bcrypt.js/issues/514
The g++ compiler was needed:
sudo apt-get install build-essential g++

Related

Confluence "Hello World" Macro help - NPM install/start not working

I am trying to make my first confluence macro and I am following the instructions laid out here:https://developer.atlassian.com/cloud/confluence/getting-started/?_ga=2.78735767.2027190294.1547046060-2004234667.1546438516
Currently, I am having trouble with steps 2 and 4; NPM install and NPM start:
Received the following errors:
➜ ~ cd confluence_app
➜ confluence_app
➜ confluence_app ls
confluence-helloworld-addon credentials.json package-lock.json
➜ confluence_app ls
confluence-helloworld-addon
➜ confluence_app cd confluence-helloworld-addon
➜ confluence-helloworld-addon git:(master) npm install package.json
npm notice created a lockfile as package-lock.json. You should commit this file.
+ package.json#2.0.1
added 74 packages from 35 contributors and audited 162 packages in 29.12s
found 0 vulnerabilities
➜ confluence-helloworld-addon git:(master) ✗ npm start
> helloworld-addon#0.0.1 start /Users/serdarmustafa/confluence_app/confluence-helloworld-addon
> node app.js
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module 'express'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/Users/serdarmustafa/confluence_app/confluence-helloworld-addon/app.js:6:15)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! helloworld-addon#0.0.1 start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the helloworld-addon#0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/serdarmustafa/.npm/_logs/2019-01-12T09_26_18_269Z-debug.log
run npm cache clean --force first, and then run npm install, then npm start
this should fix it..
--
OR delete the node_modules folder and re-run npm install
--
OR
1. npm cache clean --force
delete node_modules and package-lock.json,
npm install

npm Error Failed at the node-sass#4.9.0 install script

I received This error when I am trying to run "ionic start MyApp" on windows terminal.
I am running from a new machine and I already tried to reinstall nodejs and ionic but the same error is coming all the time.
Can anyone help me?
npm WARN tar invalid entry
> node-sass#4.9.0 install C:\Users\Felipe\Desktop\Kokua App\KokuaApp1\node_modules\node-sass
> node scripts/install.js
module.js:549
throw err;
^
Error: Cannot find module 'minimatch'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\Felipe\Desktop\Kokua
App\KokuaApp1\node_modules\true-case-path\node_modules\glob\glob.js:44:17)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
npm WARN rollback Rolling back node-pre-gyp#0.10.0 failed (this is probably harmless): EPERM: operation not
permitted, scandir 'C:\Users\Felipe\Desktop\Kokua App\KokuaApp1\node_modules\fsevents\node_modules'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted
{"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.9.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.9.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Felipe\AppData\Roaming\npm-cache\_logs\2018-06-13T23_54_19_462Z-debug.log
Try installing the latest version of ionic:
$ npm cache verify
$ npm i -g ionic cordova
If this doesn't work, you need to install the library minimatch manually:
$ npm i --save minimatch
Solve the problem with those steps:
$ npm uninstall cordova ionic
$ npm cache clean -f
$ npm install npm -g
Then uninstall nodejs, reinstall again and reinstall ionic cordova
$ npm install -g cordova ionic

Cannot install node.js module

My CI tool uses node version 4.8.3. So I had to roll back my local node.js from 6 to 4.8.3. Now when I do npm install -g I see the following error.
I wasnt facing the error when I was using 6x version but with 4.8.3 I am. Please advice?
C:\Users\jasharma\gitrepo\Protractor Framework\customer-portal>npm install -g
npm WARN deprecated nodemailer#0.7.1: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN engine selenium-webdriver#3.4.0: wanted: {"node":">= 6.9.0"} (current: {"node":"4.8.3","npm":"2.15.11"})
npm WARN peerDependencies The peer dependency karma#>=0.9 included from karma-junit-reporter will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated mimelib#0.2.19: This module is deprecated
npm WARN deprecated node-uuid#1.4.8: Use uuid module instead
npm WARN engine webdriver-manager#10.3.0: wanted: {"node":">=4","npm":">=3"} (current: {"node":"4.8.3","npm":"2.15.11"})
> chromedriver#2.30.1 install C:\Users\jasharma\AppData\Roaming\npm\node_modules\npmpackages\node_modules\chromedriver
> node install.js
module.js:327
throw err;
^
Error: Cannot find module '../dotjs/validate'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\Users\jasharma\AppData\Roaming\npm\node_modules\npmpackages\node_modules\request\node_modules\har-validator\node_modules\ajv\lib\compile\index.js:18:25)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
npm WARN deprecated minimatch#0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN optional dep failed, continuing fsevents#1.1.2
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g"
npm ERR! node v4.8.3
npm ERR! npm v2.15.11
npm ERR! code ELIFECYCLE
npm ERR! chromedriver#2.30.1 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the chromedriver#2.30.1 install script 'node install.js'.
npm ERR! This is most likely a problem with the chromedriver package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs chromedriver
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls chromedriver
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\jasharma\gitrepo\Protractor Framework\customer-portal\npm-debug.log
C:\Users\jasharma\gitrepo\Protractor Framework\customer-portal>
Either:
Update the CI tool so it can run on a modern version of NodeJS
Use a tool like nvm to install multiple versions of NodeJS at the same time

Unable to run server and error displayed in command prompt

I am trying to open the web page with the code followed in github and unable to run the server facing the errors and displayed in command prompt as below:
Code link: https://github.com/mschwarzmueller/nodejs-basics-tutorial/tree/master/09-mongodb
Error:
05-express-first-app#0.0.0 start C:\Users\Atchaya\Downloads\nodejs-basics-tutorial-master\09-mongodb
node ./bin/www
module.js:471
throw err;
^
Error: Cannot find module 'express'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\Atchaya\Downloads\nodejs-basics-tutorial-master\09-mongodb\app.js:1:77)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! 05-express-first-app#0.0.0 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the 05-express-first-app#0.0.0 start script 'node ./bin/www'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the 05-express-first-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./bin/www
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs 05-express-first-app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls 05-express-first-app
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Atchaya\AppData\Roaming\npm-cache\_logs\2017-04-19T14_14_54_505Z-debug.log
Go you your 09-mongodb folder, then run npm install command, then run npm run start.
npm install -
This command installs a package, and any packages that it depends on.
If the package has a shrinkwrap file, the installation of dependencies
will be driven by that.
By default, npm install will install all modules listed as
dependencies in package.json.

npm start command I am getting syntaxerror: use of const in strict mode

when I run npm start command I am getting the below error
I followed the below steps in the link
https://github.com/kriasoft/react-starter-kit/blob/master/docs/getting-started.md
can you tell me how to fix it
providing error below
xxx-nameKumar--MacBook-Pro:MyApp xxx-name$ npm start
> # start /Users/xxx-name/Desktop/FrontEnd/MyApp
> babel-node tools/run start
/Users/xxx-name/Desktop/FrontEnd/MyApp/tools/run.js:20
const task = typeof fn.default === 'undefined' ? fn : fn.default;
^^^^^
SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at loader (/Users/xxx-name/Desktop/FrontEnd/MyApp/node_modules/babel-cli/node_modules/babel-register/lib/node.js:126:5)
at Object.require.extensions.(anonymous function) [as .js] (/Users/xxx-name/Desktop/FrontEnd/MyApp/node_modules/babel-cli/node_modules/babel-register/lib/node.js:136:7)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at /Users/xxx-name/Desktop/FrontEnd/MyApp/node_modules/babel-cli/lib/_babel-node.js:161:27
at Object.<anonymous> (/Users/xxx-name/Desktop/FrontEnd/MyApp/node_modules/babel-cli/lib/_babel-node.js:162:7)
at Module._compile (module.js:460:26)
npm ERR! Darwin 14.5.0
npm ERR! argv "node" "/usr/local/bin/npm" "start"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! # start: `babel-node tools/run start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # start script 'babel-node tools/run start'.
npm ERR! This is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! babel-node tools/run start
npm ERR! You can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/xxx-name/Desktop/FrontEnd/MyApp/npm-debug.log
You have syntax error:
SyntaxError: Use of const in strict mode.
Do you have 'use strict' in your code?
What version of node do you have?
The const and let are part of ES6 and are not enabled by default in Node.js 0.10 or 0.12.
Update nodejs. Const is a new feature. The version you have (0.12.0) is outdated. The link says you need 5.0 or newer. Download and install 5.9.1 (not 4.4.1) form https://nodejs.org/en/. Then try again.
You can try to update your npm by typing
sudo Npm install -g npm

Categories