azure mobile services error cannot find module 'azure-storage' - node.js

I have been using Azure-storage npm module in my AzureMobileService custom API for past couple of months and all has been working fine, till couple of days back it started giving me this error - cannot find module 'azure-storage'. Its strange because I haven't changed my code a bit, actually the day it start giving me this error, I had checked my app(HTML/JS app) in the morning, it was all working good. But when I came back from work and ran the app, I got this error. below is the code in my custom api where I get this error
var azure = require('azure-storage');
var retryOperationFilter = new azure.ExponentialRetryPolicyFilter();
var tableService= azure.createTableService().withFilter(retryOperationFilter);
and I do have azure-storage included in my package.json -
"dependencies": {"tracer": "0.7.3", "colors" : "1.0.3", "lodash" :"2.4.1", "azure-storage": "0.4.1"},
I asked this question at 'Azure-storage' npm page, but didn't get much help, so now trying here; its been two days now and I haven't got it resolved, its very annoying and I am at my wits end.
anyone out there has experienced same or may have any idea, will much appreciate if you can kindly share anything you may have got on this.

finally got it working by doing a manual npm install 'azure-storage' to my mobile service.
I never thought of trying a manual npm install because other node modules I have in my package.json (like tracer, lodash) work fine with no manual npm install. Also, as I remember reading, if I just include the npm module I want to use in my mobile service's package.json and push it, mobile service on the server installs it and restarts, and I don't need to install myself manually. And thats what has been happening when my code was working till last week.

Related

How can I solve a crash in an Adonis app starting?

this is my first question ever. I'm trying to run an Adonis.js app by entering adonis serve --dev at the terminal. The messages are always the same in this succession:
SERVER STARTED
Watching files for changes...
Fatal error in , line 0
Check failed: U_SUCCESS(status).
FailureMessage Object: 000000D7655ECBA0Application crashed, make sure to kill all related running process, fix the issue and re-run the app
The only thing that changes is the FailureMessageObject. My Node version is 12.0, npm 6.9.
I can't say anything seriously working on your situation cause you gave me no detailed data but I know that surely you are doing something wrong.
It could be better if you at least mentioned the version of adonisjs you've been using.
Anyway, if you learned to run your server from a video from someone else's youtube channel, I strongly recommend you to read documentation and stop watching those videos.
And for adonisjs there are 2 different documentation:
adonisjs's Documentation, version 4.1 or less.
You can change the version on top left combo box.
adonisjs's preview Documentation, version 5.0.
Actually the documentation is not still completed at this time but the version is stable. yeah, that's the reason why I wrote preview.
And that's it, start recreating an adonisjs app from documentation guides.
I solved it. It was something with node or npm. I followed this steps enumerated in this post: How to completely remove node.js from Windows. Reinstalled node. Installed Adonis and it's CLI again and created an app and this time the app didn't crashed, and ran smoothly (after that I also created some migrations and they too worked well).

jHipster shows "An error has occurred :-(" While opening the application in the Internet explorer but works fine in chrome browser

JHipster throws the following error message at me when tried to open the application in internet explorer. But works fine in the Chrome browser.
My jhipster has spring boot with react and is connected to IBM db2 database.
Tried opening the application after running the command 'mvnw'
and also tried with 'npm start'.
Both the commands give the same result.
An error has occurred :-(
Usual error causes
1.You started the application from an IDE and you didn't run npm start or npm run webpack:build.
2.You had a network error while running npm install. If you are behind a corporate proxy, it is likely that this error was caused by your proxy. Have a look at the JHipster error logs, you will probably have the cause of the error.
3.You installed a Node.js version that doesn't work with JHipster: please use an LTS (long-term support) version, as it's the only version we support.
Building the client side code again
If you want to go fast, run ./mvnw to build and run everything.
If you want to have more control, so you can debug your issue more easily, you should follow the following steps:
1.Install npm dependencies with the command npm install
2.Build the client with the command npm run webpack:build or npm start
3.Start the server with ./mvnw or using your IDE
Getting more help
If you have a question on how to use JHipster
Go to Stack Overflow with the "jhipster" tag.
If you have a bug or a feature request
First read our contributing guidelines.
Then, fill a ticket on our bug tracker, we'll be happy to resolve your issue!
If you want to chat with contributors and other users
Join our chat room on Gitter.im. Please note that this is a public chat room, and that we expect you to respect other people and write in a correct English language!
Check out this issue - https://github.com/jhipster/generator-jhipster/issues/8250
Looks like IE is not supported at all
Finally, after some research and help from others, I figured out we need to add the polyfills to the jhipster project, Usually in the head tag of index.html file.
I tried downloading the polyfills.js and loading into my application via a script tag, but nothing seems to work, What I did instead was used the cdn from cloudflare and inserted in index.html, Which started to work like a charm.
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-polyfills/0.1.42/polyfill.js"></script>
Note: An important thing which I learned over my experience is, It makes necessary to include these polyfills to the react project if it has to work in Internet Explorer.
Suggestion from https://github.com/jhipster/generator-jhipster/issues/11566
A quick dirty workaround, set all compile option to es5 :
tsjconfig.json "target": "es5" "lib": ["es5", "dom"],
webpack.common.js mainFields: [ 'es5', 'browser', 'module', 'main'],
Fixed!
Google is doing a great job in discovering new websites and content, but sometimes we need to force Google to crawl(reindex) our website, either all of it or individual pages.
So the reason we see "An error has occurred" - it's because at the first time Google saw our site (index.html file) it indexed without additional tags.
Step 1:
Add additional meta tag in head part your index.html page:
<meta name="Description" content="your-description-here">
Step 2:
Use Google Search Console for reindex your site.
https://search.google.com/search-console/welcome
P.S. Ask question to google: "How do I get Google to recrawl my website?". It will help you to better understand Google Search Console and why you need to use it for fixing your error.
After a little research, I found we have to run the UI app also in another window using npm start, which solved the problem for me.
I had the similar challenge recently and the application was not working on Google Chrome only. It was solved by adding the lines highlighted in blue below to the application yaml in spring-boot:
Also not that the content-security-policy needs to be understood properly before altering these changes because of injection.
Reference materials: https://www.baeldung.com/spring-security-csp and https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/worker-src

Installing NPM Dependencies on Firebase Hosting [duplicate]

This question already has an answer here:
Socket.io Official Chat application not work on firebase
(1 answer)
Closed 6 years ago.
I have a simple web app made using Socket.io, Express and Node.js.
Have successfully managed to push it to Heroku via Git, and it works fine. Yay!
However, I am trying to make it work on Firebase. I seem to be having some trouble installing the NPM dependencies. I didn't use Webpack or Browserify, and for Heroku, the various NPM dependencies are installed on their server, and I can leave my node_modules folder on my local computer. The docs don't seem to talk about NPM dependencies. Am I trying to do the impossible at this time? or am I missing a few critical steps?**
I believe Firebase hosting should support the various JS dependencies because if we were just doing static websites might as well use FTP and Wordpress or something. And there's much mention of web apps on their site too..
I have tried using the Firebase CLI, and reading the docs, but it doesn't say anything about specifying my various NPM Dependencies, or even ask for my package.json contents. I am wondering if it even takes notice of the package.json file so that it will install them the way Heroku does.
Am not trying to use any Firebase features at the moment, just their hosting for now, and later on will install their login and auth, which is my final intention.
Cheers guys and thanks for your help! :D
To quote one of the Firebase developers, from this forum thread:
Firebase Hosting is for static files only. As such, you cannot run Node.js scripts on it. You should look into using something like Webtask or just run your own Node.js server on something like Google Compute Engine or Heroku.
We plan to provide a solution for you to run things like you are suggesting in the future. No timeline for it at the moment.

Basic debugging of Electron apps

I'm using Electron to build a native application, based on existing code (developed with Electron v0.26.1). I'd like to use features available on more recent versions of Electron, so I changed the version number in package.json to v0.36.9 (the most recent one so far) and reinstalled its dependencies.
Now, I fully expected the applicaton to break when running npm start, and indeed it does, but I didn't expect the error message to be so uninformative:
Error opening app
The app provided is not a valid Electron app, please read the docs on how to write one:
https://github.com/atom/electron/tree/v0.36.9/docs
Error: Cannot find module '/home/user/electron/myapp/build'
I'd appreciate if it would say why it is no longer a valid Electron app, give any sort of stack trace, or file causing the issue.
Running npm start did create a build directory like before, which contains several files, just like before the upgrade. From the way it's worded, I cannot know if the Cannot find module message is the cause of the error, or the consequence. And if it is the cause, I have no idea of who or what is requiring such module, since before the upgrade this had never happened.
I tried "standard" debugging techniques, like running npm start --debug (the flag exists, but is not useful in this situation), npm rebuild, reading the Electron FAQ, looking for any *.log files (none to be found), and looking for occurrences of require('build') or something similar (no such occurrences). Nothing helped.
How can I get any information at all about why this is failing? Every programming language/build system I know of would at least output the source file where the error occurred, and possibly more information.
In your app's package.json there probably something like:
"scripts": {
"start": "electron /home/user/electron/myapp/build"
}
That's the command that will be executed when you run npm start, so fix the path in there to point to the .js file that contains your app entry point.
Well, after bisecting changes here and there, and following Vadim Macagon's advice to look further into package.json, I found out that the following change was responsible for the complete failure:
Changing "fs-jetpack": "^0.6.4" to "fs-jetpack": "^0.7.1"
Now, unfortunately I still have absolutely no idea about why that happened, or how I could have possibly found it out other than blindingly changing settings here and there.
This is not the answer to my question (I'd still like helpful information about how to debug Electron apps to avoid similar problems in the future), but it does allow me to keep working. That is, if I decide to keep using Electron, which I'm no longer sure it's a good idea.
Edit: There is at least one related issue on Github, but it has been closed and the issue has not been resolved.

After setting up the example Loopback app, how come my StrongOps dashboard stays empty?

I followed the guidelines for installing Loopback example app, and registering to StrongOps monitoring service, like documented in the Getting Started doc
Installing and registering was flawless, but now I don't see nothing happening on my StrongOps dashboard, why ?
I even followed the step of running the stress test to be sure that some metrics are sent, but the dashboard stays empty.
$ slc run bin/create-load.js
Side note : The documentation does not mention the fact that when you quit the REPL command line, you actually stops the web server. First time I did this, I could not load the stress tests and did not understand why, until I realize the app was offline. Trivial, but should be in a Getting started doc.
Version used :
$ slc version
slc v2.2.2 (node v0.10.22)
Sorry, you got caught between rolling out updates to our tooling on npmjs.org, and updates to our documentation. We recommend running with strong-supervisor, which should be co-installed with strong-cli, though you may have to update:
npm install -g strong-supervisor
npm update -g strong-cli
At this point, you can run with
sl-run
and it will run the sample (or any app, without having to add a direct dependency on strong-agent) with strong-agent profiling, and strong-cluster-control worker/robustness management.
https://github.com/strongloop/strong-supervisor
We'll be continuing to work on our tooling integration over the next few sprints.
I believe there was a weekend maintenance done on StrongOps today. Can you retry ?
I am getting my data right now.
Shubhra
Actually, I found out.
Despite the documentation says the example app comes out of the box with strongOps support, it does not.
I had to enable it manually :
$ npm install strong-agent
In app.js, before the app dependencies :
require('strong-agent').profile();
Then, I relaunched the example app and now the dashboards starts to looks like there is something
However the charts stay empty for the moment, despite the example app and load app have been running for about 1/2 hour.

Resources