Npm Errors after installations - javascript

So I have been trying to reinstall my node-modules and for some reason I am encountering this error I have tried many things like npm i -g windows-build-tools and it did not work.
npm ERR! path C:\Quentin\Discordbot\node_modules\#discordjs\opus
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Acer\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Quentin\Discordbot\node_modules\#discordjs\opus\prebuild\node-v88-napi-v3-win32-x64-unknown-unknown\opus.node --module_name=opus --module_path=C:\Quentin\Discordbot\node_modules\#discordjs\opus\prebuild\node-v88-napi-v3-win32-x64-unknown-unknown --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp#0.1.0
npm ERR! node-pre-gyp info using node#15.13.0 | win32 | x64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for "C:\Quentin\Discordbot\node_modules\#discordjs\opus\prebuild\node-v88-napi-v3-win32-x64-unknown-unknown\opus.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/discordjs/opus/releases/download/v0.3.3/opus-v0.3.3-node-v88-napi-v3-win32-x64-unknown-unknown.tar.gz
npm ERR! node-pre-gyp http 404 https://github.com/discordjs/opus/releases/download/v0.3.3/opus-v0.3.3-node-v88-napi-v3-win32-x64-unknown-unknown.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(404): https://github.com/discordjs/opus/releases/download/v0.3.3/opus-v0.3.3-node-v88-napi-v3-win32-x64-unknown-unknown.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for #discordjs/opus#0.3.3 and node#15.13.0 (node-v88 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 404 status code downloading tarball https://github.com/discordjs/opus/releases/download/v0.3.3/opus-v0.3.3-node-v88-napi-v3-win32-x64-unknown-unknown.tar.gz```

Related

unable to install bcrypt on an ipv6 only host on ubuntu 20.0

this worked fine for an ipv4 supporting host, when I got the ipv6 only hosts from vultr.com
Its causing an issue.
in my package.json I've got the following line for bcrypt
"bcrypt": "^5.0.0",
when running npm I'm getting the following failures.
> bcrypt#5.0.0 install /var/www/production/source/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for bcrypt#5.0.0 and node#14.15.0 (node-v83 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error connect ENETUNREACH 140.82.112.4:443 - Local (0.0.0.0:0)
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: connect ENETUNREACH 104.20.23.46:443 - Local (0.0.0.0:0)
gyp ERR! stack at internalConnect (net.js:921:16)
gyp ERR! stack at defaultTriggerAsyncIdScope (internal/async_hooks.js:429:12)
gyp ERR! stack at GetAddrInfoReqWrap.emitLookup [as callback] (net.js:1064:9)
gyp ERR! stack at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:69:8)
gyp ERR! System Linux 5.8.0-25-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/var/www/production/source/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/var/www/production/source/node_modules/bcrypt/lib/binding/napi-v3" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
gyp ERR! cwd /var/www/production/source/node_modules/bcrypt
gyp ERR! node -v v14.15.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/var/www/production/source/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/var/www/production/source/node_modules/bcrypt/lib/binding/napi-v3 --napi_version=7 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/var/www/production/source/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1048:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Linux 5.8.0-25-generic
node-pre-gyp ERR! command "/usr/bin/node" "/var/www/production/source/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /var/www/production/source/node_modules/bcrypt
node-pre-gyp ERR! node -v v14.15.0
node-pre-gyp ERR! node-pre-gyp -v v0.15.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/var/www/production/source/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/var/www/production/source/node_modules/bcrypt/lib/binding/napi-v3 --napi_version=7 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm WARN acorn-jsx#5.2.0 requires a peer of acorn#^6.0.0 || ^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-import#2.20.2 requires a peer of eslint#2.x - 6.x but none is installed. You must install peer dependencies yourself.
npm WARN notification-server#1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt#5.0.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt#5.0.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! /root/.npm/_logs/2020-11-13T11_08_58_941Z-debug.log
I read online that Im required to add the routing to the npm registry in the /etc/hosts
like so
2606:4700::6810:1723 registry.npmjs.org
but still doesn't work for bcrypt.

How to install npm openlpr in nodejs

I have been trying to install the npm node-openalpr package but i am facing this error.How can i overcome this probblem?
> node-openalpr#1.1.1 install D:\My Codes\Thesis\node\node_modules\node-openalpr
> node-pre-gyp install --build-from-source --fallback-to-build
node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp ERR! UNCAUGHT EXCEPTION
node-pre-gyp ERR! stack Error: node-openalpr package.json is not node-pre-gyp ready:
node-pre-gyp ERR! stack package.json must declare these properties:
node-pre-gyp ERR! stack binary.host
node-pre-gyp ERR! stack at validate_config (D:\My Codes\Thesis\node\node_modules\node-pre-gyp\lib\util\versioning.js:220:15)
node-pre-gyp ERR! stack at Object.module.exports.evaluate (D:\My Codes\Thesis\node\node_modules\node-pre-gyp\lib\util\versioning.js:279:5)
node-pre-gyp ERR! stack at handle_gyp_opts (D:\My Codes\Thesis\node\node_modules\node-pre-gyp\lib\util\handle_gyp_opts.js:60:27)
node-pre-gyp ERR! stack at configure (D:\My Codes\Thesis\node\node_modules\node-pre-gyp\lib\configure.js:12:5)
node-pre-gyp ERR! stack at D:\My Codes\Thesis\node\node_modules\node-pre-gyp\lib\build.js:43:13
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (D:\My Codes\Thesis\node\node_modules\node-pre-gyp\lib\util\compile.js:85:9)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:311:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Windows_NT 10.0.19041
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\My Codes\\Thesis\\node\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--build-from-source" "--fallback-to-build"
node-pre-gyp ERR! cwd D:\My Codes\Thesis\node\node_modules\node-openalpr
node-pre-gyp ERR! node -v v12.16.1
node-pre-gyp ERR! node-pre-gyp -v v0.15.0
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR! <https://github.com/mapbox/node-pre-gyp/issues>
npm WARN final_thesis#1.0.0 No description
npm WARN final_thesis#1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! node-openalpr#1.1.1 install: `node-pre-gyp install --build-from-source --fallback-to-build`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the node-openalpr#1.1.1 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\MSI\AppData\Roaming\npm-cache\_logs\2020-07-06T19_34_07_841Z-debug.log
I heard there is an issue regarding node-pre-gyp versions as this openalpr package is 5 years older.
how do I overcome this problem?
I noticed in the node-openaplr package.json the dependency for node-pre-gyp points to the node-pre-gyp repository, which means it will pull in the latest version of node-pre-gyp, which is way ahead of the last commit made in the node-openaplr repository.
Fork the node-openaplr repository and specified a commit hash on the node-pre-gyp dependency in the package.json, and then installed node-openaplr to project using
yarn add https://github.com/bameyrick/node-openalpr

Unforseen errors when running sudo npm install -g #vue/cli

I've tried every solution on the web, besides he dangerous silver bullet chown -R solution to get vue.js up and running via the cli.
Supposedly, I don't have permission to manipulate the npm folder, but again I'm not too sure anymore.
In Terminal, I'm getting the error below. I've google searched the errors one by one, tried out some potential solutions but nothing worked.
What can I do to fix this?
node-pre-gyp WARN Pre-built binaries not installable for fsevents#1.2.4 and node#11.3.0 (node-v67 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/usr/local/jamf/bin/lib/node_modules/#vue/cli/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64'
gyp ERR! clean error
gyp ERR! stack Error: EACCES: permission denied, rmdir 'build'
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/jamf/bin/jamf/node" "/usr/local/jamf/bin/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "clean"
gyp ERR! cwd /usr/local/jamf/bin/lib/node_modules/#vue/cli/node_modules/fsevents
gyp ERR! node -v v11.3.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/jamf/bin/jamf/node /usr/local/jamf/bin/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js clean' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/jamf/bin/lib/node_modules/#vue/cli/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:978:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
node-pre-gyp ERR! System Darwin 17.7.0
node-pre-gyp ERR! command "/usr/local/jamf/bin/jamf/node" "/usr/local/jamf/bin/lib/node_modules/#vue/cli/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/jamf/bin/lib/node_modules/#vue/cli/node_modules/fsevents
node-pre-gyp ERR! node -v v11.3.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/jamf/bin/jamf/node /usr/local/jamf/bin/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js clean' (1)
npm WARN #apollographql/apollo-upload-server#5.0.3 requires a peer of graphql#^0.13.1 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules/#vue/cli/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
+ #vue/cli#3.2.1
You can use the chown -R option. Because the folders it's trying to access were made by another proces, your user account is not the owner, and thus can't make changes there. When you use chown -R you just change the ownership of the folder to your user, not dangerous. I had to do it a couple of times for npm on my new laptop.
the command you would want to use is:
sudo chown <username> -R ./*
In folder: /usr/local/jamf/bin/lib i think, if that doesn't work, try going up one folder and use the same command there.
sudo npm install -g #vue/cli --unsafe-perm
See this vue-cli issue on GitHub

npm install bcrypt fails in install

I am working on a express js and want to install bcrypt module for data authentication but get this errors again and again.
bcrypt#3.0.0 install /media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt
node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Pre-built binaries not installable for bcrypt#3.0.0 and node#9.11.0 (node-v59 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt/lib'
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt/build'
gyp ERR! System Linux 4.4.0-134-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt/lib/binding" "--napi_version=3" "--node_abi_napi=napi"
gyp ERR! cwd /media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt
gyp ERR! node -v v9.11.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt/lib/binding --napi_version=3 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:180:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:936:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
node-pre-gyp ERR! System Linux 4.4.0-134-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt
node-pre-gyp ERR! node -v v9.11.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.2
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt/lib/binding --napi_version=3 --node_abi_napi=napi' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt#3.0.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt#3.0.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! /home/iron/.npm/_logs/2018-08-30T06_44_17_236Z-debug.log
Node: v9.11.0
Npm : 6.4.1
node-pre-gyp : 0.11.0
In this issues you can just install bcrypt-nodejs or bcryptjs instead of bcrypt by the following commend:
npm install --save bcrypt-nodejs && npm uninstall --save bcrypt
After that, you just call this methode in the file server.js like this:
var bcryptNodejs = require('bcrypt-nodejs'); //Or bcryptjs

Permission denied during npm install even though I run it as root

same as the title. I ran npm install as root but still getting permission error. what should I do? I never got into this type of situation. I tried chmod -R 777 *, chown nobody:nogroup -R * in the project folder but nothing has changed.
Here's the error
Error: Command failed: npm install http fs path passport passport-facebook express-session connect-redis redis express-param compression express-enforces-ssl helmet ms connect-multiparty passport-runkeeper underscore.string moment-timezone nodemailer-ses-transport stripe simple-onesignal sequelize underscore uuid strava-v3 multer sharp bluebird querystring node-libcurl --save
npm WARN deprecated graceful-fs#3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
node-pre-gyp info it worked if it ends with ok
node-pre-gyp verb cli [ '/usr/local/bin/node',
node-pre-gyp verb cli '/Users/philipyoonshin_spryfit/spryfit-node/node_modules/node-libcurl/node_modules/.bin/node-pre-gyp',
node-pre-gyp verb cli 'install',
node-pre-gyp verb cli '--fallback-to-build' ]
node-pre-gyp info using node-pre-gyp#0.6.36
node-pre-gyp info using node#8.9.4 | darwin | x64
node-pre-gyp verb command install []
node-pre-gyp info check checked for "/Users/philipyoonshin_spryfit/spryfit-node/node_modules/node-libcurl/lib/binding/node_libcurl.node" (not found)
node-pre-gyp http GET https://github.com/JCMais/node-libcurl/releases/download/v1.2.0/node_libcurl-v1.2.0-node-v57-darwin-x64.tar.gz
node-pre-gyp http 200 https://github.com/JCMais/node-libcurl/releases/download/v1.2.0/node_libcurl-v1.2.0-node-v57-darwin-x64.tar.gz
node-pre-gyp info install unpacking node_libcurl.node
node-pre-gyp info tarball done parsing tarball
node-pre-gyp info ok
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/philipyoonshin_spryfit/spryfit-node/node_modules/sharp/build'
gyp ERR! System Darwin 17.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/philipyoonshin_spryfit/spryfit-node/node_modules/sharp
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp#0.18.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp#0.18.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm always run post-install scripts with a non-privileged users for security reason. So even if you ran the command with sudo, the install scripts will be ran as non-privileged.
This is for obvious security reason, if npm wasn't downgrading the permissions, this means you'd be giving full control of your machine to any npm packages - some of those who might be malicious.

Categories

Resources