localhost:3000 shows internal server error - node.js

I am new at using node.js and i am trying this new react framework called frontity for wordpress. Everything went great at first and "npx frontity dev" command worked fine and i was able to access the "localhost:3000" then while pointing my wordpress site i thought i messed up details and i didn't know the default ones. So i deleted the directory that was created by Node.js using "npx frontity create my-app". Then i uninstalled node.js and tried same again. Now this time when i used "npx frontity dev" it displayed internal server error. So i deleted the Displayed Errordirectory again and uninstalled and re installed node.js multiple times. Now when i try using "npx frontity dev" command it displays the error shown in images with keywords " WARNING in C:/my-app/node_modules/#babel/runtime/helpers/defineProperty.js
There are multiple modules with names that only differ in casing." Help me, i am unable to find a solution to this.

Related

Node running a different React application when using "npm run start"

I was developing a different app titled "Video Chat" around 5-6 hours ago and after my work was done I switched over to a different app and ran it using the "npm start" command, however the command now only starts the "Video Chat" app in the localhost and I'm stuck here. Any suggestions? Both applications were created using ReactJS.
The problem persists even after I've deleted the "Video Chat" application, reinstalled Node LTS version and even changed the partitions of the project I'm working on now. I want to run my current application on the localhost for development.
npm start depends upon what is written under package.json file on start property on scripts object.
Go to task manager and stop the node engine. And start your application in a new terminal. It always happens due to the cashes of the current engine. Once you stopped the node in the background process, it will load your command next time in a new node engine.

React project compile successfully can't view from the browser

I did several react projects before but it is the first time I encountered this problem.
After I ran
npx create-react-app myapp
cd myapp
I created a react project, then I ran
npm start
It looks very fine:
However, the project did not show in the browser, when I go to the localhost:3000 it reminds me "This site can’t be reached":
I tried to change the port but no matter what I do, this situation still lasts. The environment is good, the computer is good, the nodejs is good, anyone has encountered this kind of situation before can give me some advice? Thanks!

Cannot open the react-foundation starter project

I'm new to React and Node, so I apologize ahead of time if this question shows a high level of ignorance when it comes to the subject. I'm trying to use the react-foundation library, and they provide a starter boilerplate at this link: https://github.com/nordsoftware/react-starter.
I follow the directions to
Install the dependencies using "npm install"
Start the development server with "npm start".
I cannot figure out how to get the page to open in my browser. I tried making a server.js file, and running "node server.js," but I get a "Cannot GET /" error. I do not know how I can open this in by the browser.
When you "npm start", it should tell you where webpack-dev-server is serving at in the console log. Otherwise, I can see this in the webpack config file, dev mode:
development.entry.app.push('webpack-dev-server/client?http://localhost:8080');
(https://github.com/nordsoftware/react-starter/blob/develop/webpack/development.js)
So try pointing your browser to localhost:8080. You don't need a supplementary server.js file.

Problems with webpack build, using angular-cli

I am using angular-cli with built-in webpack and encounter the following problem: if I use ng serve --host 0.0.0.0 --port 3000 everything works fine, but when I try to build the app (no matter developer mode or production) with ng build and then put it into my nginx, not a single route works and every attempt of browser to download image, which is used on start page, ends with 404 error. What am I doing wrong? Googled a ton of stuff and nothing seems to be a solution.
Some additional info:
angular-cli: 1.0.0-beta.21
node: 6.9.4
os: win32 x64
So for everyone who encounters this problem, after some research I found this:
1) To solve problem with styles not loading properly, add encapsulation: ViewEncapsulation.None to each of your components #Component() decorator, this way it's going to bundle styles properly. More info here: https://angular.io/docs/ts/latest/guide/component-styles.html#!#loading-styles
2) Make sure all your images are stored inside assets folder. If you store them in some other folder like images, just put that images folder inside assets
3) And for information about paths not working on page reload, have a look at this question and read some information about strategies: Angular 2 : 404 error occur when i refresh through Browser
Also this link has config examples https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions#how-to-configure-your-server-to-work-with-html5mode

heroku running gulp build

i am trying to install a node app onto heroku. My application requires both gulp build and gulp install to be called on the server upon instillation, however i am having troubles doing this.
I have tried writing this inside of the package.json:
"scripts":"gulp build && gulp install"
which works at first, but after about an hour the server must restart and recall the script causing for the contents of the server to be rebuilt. this removes all of my content such as newly written blogs or changes.
I have also tried using the heroku toolbelt
heroku run gulp build
heroku run gulp install
However, even though it produces the correct console write lines and looks asif it has made the necessary changes, it hasn't, the server produces an error which proves that the resources haven't been built meaning that the console command didnt make any changes to the actual server files.
Am i missing something out here? Thanks in advance.
So i have figured out that the problem lies with the fact that i have tried to use a LevelDB database on heroku. Apparently, heroku uses no-writable dynos, meaning that the levelDB database is unable to save.

Resources