I'm trying to create a Node.js app with LevelDB module in Microsoft Azure app service. I followed the steps given in this link to create an app. I ran that locally (Windows10 64bit) and pushed it to the Azure. When I open the site in browser, it returns HTTP 500 error.
When I run npm start in the terminal on https://{app-name}.scm.azurewebsites.net/DebugConsole , it returns the error at.
at D:\home\site\wwwroot\node_modules\levelup\lib\levelup.js:119:34
at D:\home\site\wwwroot\node_modules\abstract-leveldown\abstract-leveldown.js:39:16
Express server listening on port 3000
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\4.4.7\\node.exe" "D:\\Program Files (x86)\\npm\\2.15.8\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v4.4.7
npm ERR! npm v2.15.8
npm ERR! code ELIFECYCLE
npm ERR! appName#0.0.1 start: `node app.js`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the appName#0.0.1 start script 'node app.js'.
npm ERR! This is most likely a problem with the appName package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs appName
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls appName
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\home\site\wwwroot\npm-debug.log
I checked the code in levelup.js:119:34 and added the log for that error. That log returns The filename, directory name, or volume label syntax is incorrect.
I'm using LevelDB for storing the data. I initialised the db by var db = levelup('./mydb', { valueEncoding: 'json'});
What should I do to use the levelDB in Microsoft Azure? Any help would be appreciated. Thanks.
According the requirement description at https://github.com/level/levelup#tested--supported-platforms, the module requires node-gyp via installation. And Azure App Service does not support all native modules and might fail at compiling those with very specific prerequisites.
Please double check whether modules have been install successfully on Azure Web Apps via Kudu console site, and you can install these modules on your local Windows machine in 32 bit, and deploy the entire application including node_modules folder to Azure Web Apps.
You can refer to https://azure.microsoft.com/en-us/documentation/articles/nodejs-use-node-modules-azure-apps/ for details.
Any further concern, please feel free to let me know.
Related
i have already checked node and NPM version it is showing properly but while creating react app using Vite.js it is not working
This is the error :
npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/create-vite failed, reason: connect ETIMEDOUT 104.16.24.35:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\91820\AppData\Local\npm-cache_logs\2022-08-16T14_30_29_511Z-debug-0.log
According to this stackoverflow post:
ETIMEDOUT Error while installing Node packages on Windows
Can you try the following command?
npm config delete proxy
Or this commands in order.
npm config delete proxy
npm config delete http-proxy
npm config delete https-proxy
I am trying to deploy an example app on the azure portal and am encountering some difficulties.
At first I'm just testing, so I've created an angular app with just ng new poc-pwa-angular-v2. After that I went up to a Bitbucket repository.
In Azure I created a web application and in the deployment options I connected on bitbucket and set my master branch.
I tried to generate the scripts with kudu (deploy.cmd and .deployment), but I got an error on the first deploy.
Can anyone give a tip?
Look at my log.
Command: deploy.cmd
Handling node.js deployment.
Creating app_offline.htm
KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot'
Copying file: 'package.json'
Deleting app_offline.htm
Invalid start-up command "ng serve" in package.json. Please use the format "node <script relative path>".
Looking for app.js/server.js under site root.
Missing server.js/app.js files, web.config is not generated
The package.json file does not specify node.js engine version constraints.
The node.js application will run with the default node.js version 10.6.0.
Selected npm version 6.1.0
> poc-pwa-angular-v2#0.0.0 postinstall D:\home\site\wwwroot
> npm run build
> poc-pwa-angular-v2#0.0.0 build D:\home\site\wwwroot
> ng build
'ng' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! poc-pwa-angular-v2#0.0.0 build: `ng build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the poc-pwa-angular-v2#0.0.0 build 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! D:\local\AppData\npm-cache\_logs\2018-11-13T22_16_35_989Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! poc-pwa-angular-v2#0.0.0 postinstall: `npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the poc-pwa-angular-v2#0.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:
Failed exitCode=1, command="D:\Program Files (x86)\nodejs\10.6.0\node.exe" "D:\Program Files (x86)\npm\6.1.0\node_modules\npm\bin\npm-cli.js" install --production
npm ERR! D:\local\AppData\npm-cache\_logs\2018-11-13T22_16_36_053Z-debug.log
An error has occurred during web site deployment.
Invalid start-up command "ng serve" in package.json. Please use the format "node <script relative path>".\r\nMissing server.js/app.js files, web.config is not generated\r\n'ng' is not recognized as an internal or external command,\r\noperable program or batch file.\r\nnpm ERR! code ELIFECYCLE\r\nnpm ERR! errno 1\r\nnpm ERR! poc-pwa-angular-v2#0.0.0 build: `ng build`\r\nnpm ERR! Exit status 1\r\nnpm ERR! \r\nnpm ERR! Failed at the poc-pwa-angular-v2#0.0.0 build script.\r\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\r\n\r\nnpm ERR! A complete log of this run can be found in:\r\nnpm ERR! D:\local\AppData\npm-cache\_logs\2018-11-13T22_16_35_989Z-debug.log\r\nnpm ERR! code ELIFECYCLE\r\nnpm ERR! errno 1\r\nnpm ERR! poc-pwa-angular-v2#0.0.0 postinstall: `npm run build`\r\nnpm ERR! Exit status 1\r\nnpm ERR! \r\nnpm ERR! Failed at the poc-pwa-angular-v2#0.0.0 postinstall script.\r\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\r\n\r\nnpm ERR! A complete log of this run can be found in:\r\nnpm ERR! D:\local\AppData\npm-cache\_logs\2018-11-13T22_16_36_053Z-debug.log\r\nD:\Program Files (x86)\SiteExtensions\Kudu\78.11022.3613\bin\Scripts\starter.cmd deploy.cmd
The issue is that on Azure Angular cli is not installed.
You will need to do ng build locally(or as part of your build and release pipe line. You can also use Azure DevOps builds for that where you have 240 build minutes for free) and upload it to (just options):
Azure App service.
Upload it to blob storage and use Azure functions proxy to serve your files.
If you need server side rendering then you will need to upload it as an NodeJs app or part of .net app
Thanks for the time of yours, in this case I removed the package.json script block and went up again and it worked.
...
"version": "0.0.0",
"scripts": {
},
...
So I've been trying to create a server for dynamic web pages using Openshift, so I created a bare-bones node.js/Express template just for connecting to Index.html (to test the code) but when I try and run the code Openshift goes into a crash loop back-off.
Note: I'm new to Node.js and back-end development in general so please be thorough with your answers.
The Openshift error log:
Environment:
DEV_MODE=false
NODE_ENV=production
DEBUG_PORT=5858
Launching via npm...
npm info it worked if it ends with ok
npm info using npm#3.10.9
npm info using node#v6.11.3
npm ERR! Linux 3.10.0-693.15.2.el7.x86_64
npm ERR! argv "/opt/rh/rh-nodejs6/root/usr/bin/node" "/opt/rh/rh-nodejs6/root/usr/bin/npm" "run" "-d" "start"
npm ERR! node v6.11.3
npm ERR! npm v3.10.9
npm ERR! path /opt/app-root/src/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/opt/app-root/src/package.json'
npm ERR! enoent ENOENT: no such file or directory, open '/opt/app-root/src/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /opt/app-root/src/npm-debug.log
The github repo:
https://github.com/TrueAmbition001/TrueAmbition001.github.io
Thanks in advance.
The Node.js S2I builder requires the package.json and application code to be in the root directory of the repo, you have it in a sub directory. So the structure of your code doesn't match what is required.
For some details on the S2I builder for Node.js, see:
https://github.com/sclorg/s2i-nodejs-container/tree/master/8
I have already set proxy configurations in .npmrc file.
Executing the npm install command gives me error as follows"
$ npm install npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program
Files\nodejs\node.exe" "C:\Program
Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" npm ERR!
node v6.9.4 npm ERR! npm v3.10.10 npm ERR! code ECONNRESET
npm ERR! network tunneling socket could not be established,
statusCode=400 npm ERR! network This is most likely not a problem with
npm itself npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad
network settings. npm ERR! network npm ERR! network If you are behind
a proxy, please make sure that the npm ERR! network 'proxy' config is
set properly. See: 'npm help config'
npm ERR! Please include the following file with any support request:
npm ERR! D:\Pooja\quickstart\npm-debug.log
The .npmrc file in user folder contains following values
1. registry=https://registry.npmjs.org/
2. proxy=http://proxy#domain.com:8080/
3. http_proxy=http://username:password#proxy#domain.com:8080/
Is there any way to solve this issue?
Does your proxy URL have '#' symbol in it? # symbol separates the user ID and password from the URL. If it does, you can try using '%40' to replace it.
Also, it is https-proxy not http_proxy.
A correct config would look like -
registry=https://registry.npmjs.org/
proxy=http://username:password#proxydomain:8080/
https-proxy=https://username:password#proxydomain:8080/
https://docs.npmjs.com/misc/config#proxy
first give the command
and check if proxy is set,npm config get proxy if not set do the following from command prompt
npm config set proxy http://username:password#proxy address:8080
npm config set https-proxy http://username:password#proxy address:8080
and if password contains '#'in password, then replace it with '%40'
Someone who comes from china may solve this problem by using Taobao mirror.
npm --registry=https://registry.npm.taobao.org install
ok ... first time I'm trying my hand at node.js.
installed it a while back, and not sure how i installed it.
last night, decided to tackle a tutorial regarding node.js and express.
checked my version of node which is v0.8.14 and npm which is 1.1.65. (I'm on Mac, 10.6.8 version)
but did this anyway
npm install -g express
seemed to go ok ... but whenever I tried to generate a new application via
express new ProjectName
I got this:
-bash: express: command not found
Decided to try
sudo npm install express -g
which again seemed to go well ... but again, the express new ProjectName got the same statement.
tried again:
npm install -g express
got a lot of errors unlike the first time.
npm WARN package.json application-name#0.0.1 No README.md file found!
AA-s-MacBook-Pro:express_node aa$ express new HotPie
-bash: express: command not found
AA-s-MacBook-Pro:express_node aa$ npm cache clean
AA-s-MacBook-Pro:express_node aa$ npm install -g express
npm http GET https://registry.npmjs.org/express
npm http 200 https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/express/-/express-3.0.6.tgz
npm http 200 https://registry.npmjs.org/express/-/express-3.0.6.tgz
npm ERR! error rolling back Error: EPERM, chmod '/usr/local/share/npm/bin/express'
npm ERR! error rolling back express#3.0.6 { [Error: EPERM, chmod '/usr/local/share /npm/bin/express']
npm ERR! error rolling back errno: 50,
npm ERR! error rolling back code: 'EPERM',
npm ERR! error rolling back path: '/usr/local/share/npm/bin/express' }
npm ERR! Error: EPERM, chmod '/usr/local/share/npm/bin/express'
npm ERR! { [Error: EPERM, chmod '/usr/local/share/npm/bin/express']
npm ERR! errno: 50,
npm ERR! code: 'EPERM',
npm ERR! path: '/usr/local/share/npm/bin/express' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 10.8.0
npm ERR! command "/usr/local/Cellar/node/0.8.14/bin/node" "/usr/local/bin/npm" "install" "-g" "express"
npm ERR! cwd /Users/aa/Documents/express_node
npm ERR! node -v v0.8.14
npm ERR! npm -v 1.1.65
npm ERR! path /usr/local/share/npm/bin/express
npm ERR! code EPERM
npm ERR! errno 50
npm ERR! stack Error: EPERM, chmod '/usr/local/share/npm/bin/express'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/aa/Documents/express_node/npm-debug.log
npm ERR! not ok code 0
and so it went on and on: errors ... or no errors. I'm at total loss. and online literature on fixing this problem seems rather sparse.
advice, please?
oh, also saw this somewhere online: (whatever it means)
/usr/local/share/npm/bin/express
which resulted in this:
destination is not empty, continue?
destination is not empty, continue? (yes or no) yes
create : .
create : ./package.json
create : ./app.js
create : ./public/javascripts
create : ./public/images
create : ./public/stylesheets
create : ./public/stylesheets/style.css
create : ./routes
create : ./routes/index.js
create : ./routes/user.js
create : ./views
create : ./views/layout.jade
create : ./views/index.jade
create : ./public
install dependencies:
$ cd . && npm install
run the app:
$ node app
so ... ??? any advice would be appreciated! (please also let me know if I left any pertinent information required)
Sounds like you need to edit your path variable.
Edit your ~/.bash_profile. Add this export somewhere.
export PATH=/usr/local/bin:$PATH:/usr/local/share/npm/bin
What's happening is that node isn't setting up its PATH correctly. I've had this happen to me before. Its something they should fix.
You may not have a .bash_profile. In *nix systems, there are a few different files you can place in your home directory to add environment variables and such.
bash_profile is the one I prefer, so in the terminal cd to ~ and touch .bash_profile.
Then edit it via nano .bash_profile or whatever editor you like.
(In nano, control-o to save, control-x to exit.)
When you've added it, do: source .bash_profile
Then try which express and see if it shows the path.