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

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.

Related

Can't install #firebase/testing in firebase CLI

I was using firebase CLI for testing my cloud firestore security rules and I received the following error while installing #firebase/testing using npm install #firebase/testing --save-dev-
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
> core-js#3.6.5 postinstall E:\Coding\Web\poll-app firebase test\test\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
internal/modules/cjs/loader.js:967
throw err;
^
Error: Cannot find module 'E:\Coding\Web\poll-app firebase test\test\node_modules\core-js\-e'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:964:15)
at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1346:46)
at Function.Module._load (internal/modules/cjs/loader.js:840:27)
at Function.Module.runMain (pkg/prelude/bootstrap.js:1375:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm WARN test#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 1
npm ERR! core-js#3.6.5 postinstall: `node -e "try{require('./postinstall')}catch(e){}"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the core-js#3.6.5 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Can someone tell me what I should be doing?
So, I could fix it by doing the following. I went to my firebase console and opened a cloud shell from security rules playground option. Once it had loaded, I followed the steps given by the learning assistant shown on the right panel and set up my cloud shell by cloning the tutorials from GitHub. Then, I went to quickstart-testing/cs-walkthrough/functions and downloaded the node_modules folder. It was download as a tar file. I ran WinRAR with admin privileges and extracted the tar file. And it worked. I really don't understand how and why it worked but this is what I did to solve the problem.

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

npm install fails with EACCES: permission denied

I am trying to install Node.js on a Debian 9 (Stretch) box. Initially I run the following commands as root:
curl -Lo node.tar.xz https://nodejs.org/dist/v10.15.0/node-v10.15.0-linux-x64.tar.xz
echo "4ee8503c1133797777880ebf75dcf6ae3f9b894c66fd2d5da507e407064c13b5 node.tar.xz" | sha256sum -c -
tar xJf node.tar.xz
cp -a node-v10.15.0-linux-x64/. /usr/local/
Next I run npm install, from the source dir of the project I am trying to build, with a regular user account, and get the following error:
> git-validate#2.2.2 install /blah/node_modules/git-validate
> node bin/install
fs.js:115
throw err;
^
Error: EACCES: permission denied, open '/blah/.git/hooks/pre-commit'
at Object.openSync (fs.js:439:3)
at Object.writeFileSync (fs.js:1190:35)
at Object.exports.installHooks (/blah/node_modules/git-validate/lib/utils.js:248:12)
at Object.<anonymous> (/blah/node_modules/git-validate/bin/install.js:3:7)
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)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
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! git-validate#2.2.2 install: `node bin/install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the git-validate#2.2.2 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/2019-01-20T19_55_48_025Z-debug.log
The source dir is a git repo cloned under the same user account which is now running npm install.
What am I doing wrong?

Error: Cannot find module 'AsyncDependencyToInitialChunkWarning'

I have succesfully installed and deployed to my Debian production server a react app using "create-react-app". I've then pushed it to my repo and pulled it on my development computer (Win10). Here's the output for npm install && npm start
C:\Users\Shad\shadfront>npm install
[ ...........] / extract:webpack-manifest-plugin: verb lock using C:\Users\Shad\AppDat
[ ...........] / extract:webpack-manifest-plugin: verb lock using C:\Users\Shad\AppDa
[ ...........] / extract:webpack-manifest-plugin: verb lock using C:\Users\Shad\AppD
[ ...........] / extract:webpack-manifest-plugin: verb lock using C:\Users\Shad\AppData[ ...........] / extract
:webpack-manifest-plugin: verb lock using C:\Users\Shad\A[ ...........] / extract:webpack-manifest-plugin: verb lock
using C:\Users\Shad\A[ .npm WARN ajv-keywords#3.2.0 requires a peer of ajv#^6.0.0 but none is installed. You must ins
tall peer dependencies yourself.
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"})
added 755 packages in 21.316s
C:\Users\Shad\shadfront>npm start
> shadfront#0.1.0 start C:\Users\Shad\shadfront
> node scripts/start.js
module.js:549
throw err;
^
Error: Cannot find module './AsyncDependencyToInitialChunkWarning'
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\Shad\shadfront\node_modules\webpack\lib\Compilation.js:23:46)
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 ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! shadfront#0.1.0 start: `node scripts/start.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the shadfront#0.1.0 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! C:\Users\Shad\AppData\Roaming\npm-cache\_logs\2018-07-17T14_10_23_162Z-debug.log
What should I do in order to have my React app working on my Win10 ?
Thanks
For anyone ending up here, I've managed to fix this problem by removing my .gitiginore and commiting again.

Throwing error while executing npm install marialsql

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

Resources