Throwing error while executing npm install marialsql - node.js

I would need your help in resolving below error.
I am trying to build an angular project with mariasql as it is the backend db
In order to do that: I tried following steps
Step-1: I installed windows production tool with following command
line as maria db requires Microsoft Visual studio compiler
`"npm install --global windows-build-tools"`
After step-1, I have got visual studio and python 2.7 in my laptop when i installed the global windows build tools
Step-2: I set PYTHON Environment variable in my system
Step 3: I created a brand new angular project like below
ng new selenium-package
The project got created with node_modules
Step 4: I tried installing marialsql as below
npm install mariasql
With this, I am getting below error:
C:\Users\Jack\Documents\Tuitorial\Exercise\selenium-package\node_modules\mariasql> if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "node C:\Users\Jack\Documents\Tuitorial\Exercise\selenium-automation-builder\node_modules\node-gyp\bin\node-gyp.js" rebuild ) module.js:557
throw err;
^
Error: Cannot find module 'C:\Users\Jack\Documents\Tuitorial\Exercise\selenium-package\node_modules\mariasql\node C:\Users\Jack\Documents\Tuitorial\Exercise\selenium-automation-builder\node_modules\node-gyp\bin\node-gyp.js'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Function.Module.runMain (module.js:701:10)
at startup (bootstrap_node.js:194:16)
at bootstrap_node.js:618:3 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.1.3 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! mariasql#0.2.6 install: `node-gyp rebuild` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the mariasql#0.2.6 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\Jack\AppData\Roaming\npm-cache\_logs\2017-12-22T04_49_00_804Z-debug.log

Related

Gatsby default starter

This error came when I created gatsby-default-starter site. How to solve it. What is the problem with it?
Error message:
‼ pngquant pre-build test failed i compiling from source × Error: pngquant failed to build, make sure that libpng-dev is installed at D:\gatsby-project\my-gatsby-project\node_modules\bin-build\node_modules\execa\index.js:231:11 at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:93:5) at async Promise.all (index 0) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.3.2 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! pngquant-bin#6.0.0 postinstall: node lib/install.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the pngquant-bin#6.0.0 postinstall 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:
ERROR
Command failed with exit code 1: npm install
Error: Command failed with exit code 1: npm install
error.js:56 makeError [npm]/[gatsby-cli]/[execa]/lib/error.js:56:11
index.js:114 handlePromise [npm]/[gatsby-cli]/[execa]/index.js:114:26
task_queues.js:93 processTicksAndRejections internal/process/task_queues.js:93:5
init-starter.js:135 install [npm]/[gatsby-cli]/lib/init-starter.js:135:7
init-starter.js:202 clone [npm]/[gatsby-cli]/lib/init-starter.js:202:3
init-starter.js:343 initStarter [npm]/[gatsby-cli]/lib/init-starter.js:343:5
create-cli.js:494 [npm]/[gatsby-cli]/lib/create-cli.js:494:9
It seems that you are using Windows as OS. This issue is usually related to some additional dependencies that you may need. Try the following:
Delete your project (to avoid potentially corrupted dependencies).
Install the windows-build-tools by:
npm install --global windows-build-tools --vs2015
Run your starter command and develop it. For example:
npm install -g gatsby-cli
gatsby new gatsby-site
cd gatsby-site
gatsby develop
If the issue persists try installing manually the missing dependencies by:
npm install imagemin-pngquant#5.0.1 --save
npm install pngquant-bin#3.1.1 --save
For further details check Gatsby on Windows docs.

Installing puppeteer results in "file already exists" error

When I first tried to install puppeteer through npm, I got errors saying permission is denied for the .local-chromium folder. So I followed this SO post and that error went away, but now there is another (base path is omitted):
$ sudo npm install puppeteer --unsafe-perm=true
> puppeteer#5.2.1 install ##########/node_modules/puppeteer
> node install.js
(node:25349) ExperimentalWarning: The fs.promises API is experimental
Downloading Chromium r782078 - 126.4 Mb [====================] 100% 0.0s
ERROR: Failed to set up Chromium r782078! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
{ [Error: EEXIST: file already exists, mkdir '##########/node_modules/puppeteer/.local-chromium/linux-782078']
errno: -17,
code: 'EEXIST',
syscall: 'mkdir',
path:
'##########/node_modules/puppeteer/.local-chromium/linux-782078' }
npm WARN notsup Unsupported engine for puppeteer#5.2.1: wanted: {"node":">=10.18.1"} (current: {"node":"10.4.0","npm":"6.14.7"})
npm WARN notsup Not compatible with your version of node/npm: puppeteer#5.2.1
npm WARN notsup Unsupported engine for extract-zip#2.0.1: wanted: {"node":">= 10.17.0"} (current: {"node":"10.4.0","npm":"6.14.7"})
npm WARN notsup Not compatible with your version of node/npm: extract-zip#2.0.1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! puppeteer#5.2.1 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the puppeteer#5.2.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! ######/.npm/_logs/2020-07-30T16_32_37_096Z-debug.log
But that directory doesn't exist, nor does puppeteer at all within node_modules so I can't delete it and retry. I'm not sure what the installation is reffering to. Does anybody have any idea what it could mean?
Also, this is irrelevant but another concern is with the warnings saying that a node version >=10.18.1 is wanted and so 10.4.0 is unsupported, any ideas what's up with that as well?
I ended up using nvm to switch to the stable Node release (10.18.1) which resolved both the errors and the warnings. I guess there was some incompatibility with newer Node versions.

Installing node-sass fails on Ubuntu 18.04

I have a simple next.js project, which I created following their tutorial. It builds and runs well on my Windows development machine.
I want to deploy it on Ubuntu 18.04.02 LTS but when I clone the git project and run npm install it fails to install node-sass with the following error message:
> node-sass#4.12.0 install /var/www/example.com/beta/node_modules/node-sass
> node scripts/install.js
internal/modules/cjs/loader.js:584
throw err;
^
Error: Cannot find module '/var/www/example.com/beta/node_modules/node-sass/scripts/install.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.12.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.12.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: ...
Here is a gist of the log file. See the last few lines for the error (I have included the whole file in case there is other information that is useful).
My NodeJS version is 10.15.3 and my NPM version is 6.4.1. I am not sure how to run next.js project on Ubuntu.
Apparently, I needed to install it with --unsafe-perms flag:
npm install --unsafe-perms
No explanation onto why it needs this and the unsafe word is not recommended by many.
In addition, the folder permissions needed to be in such a way that the script can create folders. I had to create a folder as me, clone the repo there, run the npm install --unsafe-perms, and then set the permissions as of a production web server.
For reference see here.
Try installing it manually, prior to installing all of the other packages - there might be some package dependency issue.
npm install node-sass#4.12.0 && npm install
This module has striction about node versions, as below:
solution is: specify the module version when you install it.
P.S. Other approach:
if you just want to use scss/sass, use this module:
npm install sass sass-loader
this does NOT work for: node 16, ubuntu 18
npm install --unsafe-perms
for node 14, ubuntu 18 , I can install it:
npm install node-sass

Deployment fails while installing node-sass on Azure linux web app

I'm trying to deploy a website to Azure App Service running Linux, but the deployment fails. The issue seems to be with installing node-sass.
I've set Node to the most recent version that the service supports.
> node-sass#4.11.0 install /home/site/wwwroot/node_modules/node-sass
> node scripts/install.js
fs.js:126
throw err;
^
Error: EINVAL: invalid argument, open '/home/site/wwwroot/node_modules/node-sass/package.json'
at Object.fs.openSync (fs.js:559:3)
at Object.fs.readFileSync (fs.js:465:33)
at Object.Module._extensions..json (internal/modules/cjs/loader.js:695:20)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
at Module.require (internal/modules/cjs/loader.js:626:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/home/site/wwwroot/node_modules/node-sass/lib/extensions.js:7:9)
at Module._compile (internal/modules/cjs/loader.js:678:30)
npm WARN ppi-web#1.0.0 No repository field.
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":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.11.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.11.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/.npm/_logs/2019-02-07T18_09_48_891Z-debug.log
Running "/opt/nodejs/10.1.0/bin/node" "/opt/npm/6.0.1/node_modules/npm/bin/npm-cli.js" run-script build
I followed this guide. After scaffolding express application, I pushed the code to a github repo and used the Azure Extensions in VS Code to configure the deployment source to my recently create github repo and succeeded.
I'm not exactly sure how you deployed but hopefully this will help. Unfortunately I don't have enough reputation points to ask how you went about deploying but please feel free to let me know.

error pngquant-bin with npm install

I installing npm and all works until this error, I am trying to discover what its causing this problem but no success. After the installation I tried to run 'npm run dev' but with errors too. I guess because the problem with the npm install at all. I tried to install the module pngquant-bin but no success too.
If you know a way or you face this same problem already, please help me. I see the other questions about it but with any responses. Please.
pngquant-bin#4.0.0 postinstall /var/www/html/futebit/node_modules/pngquant-bin
node lib/install.js
⚠ The `/var/www/html/futebit/node_modules/pngquant-bin/vendor/pngquant` binary doesn't seem to work correctly
⚠ pngquant pre-build test failed
ℹ compiling from source
✔ pngquant pre-build test passed successfully
✖ Error: pngquant failed to build, make sure that libpng-dev is installed
at Promise.all.then.arr (/var/www/html/futebit/node_modules/pngquant-bin/node_modules/bin-build/node_modules/execa/index.js:231:11)
at process._tickCallback (internal/process/next_tick.js:68:7)
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":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pngquant-bin#4.0.0 postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pngquant-bin#4.0.0 postinstall 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/2018-07-16T14_17_27_195Z-debug.log
Pngquant require vcruntime140.dll.
Download and install 64bit and 32bit Visual C++ Redistributable for Visual Studio 2015 from https://www.microsoft.com/en-in/download/details.aspx?id=48145
The error states make sure that libpng-dev is installed. That means that you are probably missing that package.
On Debian/Ubuntu you can fix it with sudo apt install libpng-dev. That worked for me.
It seems you are trying to use the precompiled binary pngquant-bin and it fails because of incompatible libraries used in the OS, so two ways to use them:
Install system-wide pngquant package apart the node package
If you are using an old OS try upgrade the libraries then install the node package again
In case you have the newest OS, try upgrade the node package to the newest version too.

Resources