Unable to deploy Nextjs project using XAMPP - javascript

I wan to deploy my next projet to XAMPP.
I run npm run build it build successfully, how I use my project in XAMPP insted of npm run start
I add "homepage": "http://localhost/safar/" to package.json then run npm run build after that copy content of .next to safar folider.
I try http://localhost/safar/ in chrom, I expected that my project works correctly but it shows all file of my project.

Related

Run a npm based web page on Github

I'm trying to run a web page based on npm on my Gituhb repository (paul.github.io) . In it's Readme.md we can find :
# Three.js Journey
## Setup
Download [Node.js](https://nodejs.org/en/download/).
Run this followed commands:
``` bash
# Install dependencies (only the first time)
npm install
# Run the local server at localhost:8080
npm run dev
# Build for production in the dist/ directory
npm run build
```
On my laptop (windowsĂ  I succeed on installing nodejs and npm. However, I didn't find how to install these on github. Any Idea please?
In the light of the comments, I fixed the issue by building the projet with "npm run build", and I saved the output which has been made in dist/ folder in my Github repository. Thanks again to all contributors.

React + redux project not launching with instructions

This is my first React + Redux project, it works when I run it in my PC but when people follow my github instructions to run the project on their computers they get an error. "command not found: yarn"
Can anyone help me with this issue please? I wonder if my instructions are wrong in the first place
https://github.com/itsandromeda/Shoes-Store
If anyone gets to launch it succesfully without any errors please let me know.
Instructions:
Install dependencies
npm install
Install json server
npm install -g json-server
Run json server
json-server --watch db.json --port 3001
Launch project
yarn start
It all worked for me. I'm using node v8.9.4 and npm 5.6.0

How do I use two versions of Electron on the same machine

When I first started to learn Election the book I was using recommended that it be installed using npm install -g electron. Now I read on the npm website that npm install electron --save-dev is the preferred way to install it.
So I created a new project directory and ran npm init then ran
npm install electron --save-dev. According to package.json Electron 1.7.5 was installed, but when I type electron in the project directory it reports version 1.6.10 which is the version that was installed with the -g option.
Is there a way to get my new project to use 1.7.5? I have already completed a small project using version 1.6.10 and don't want to do anything that would keep it from running.
Thanks, Jim
You can run the local version of electron out of the node_modules/.bin directly -- most likely it will be called node_modules/.bin/electron.
You can use npm or gulp (or even a shellscript/batch file) to run the app for you.

Aurelia Babel unknown option base.modules error

I downloaded the skeleton project from the Aurelia docs and tried starting it up by using the command:
gulp watch
However, I get the following error:
[09:48:13] gulp-notify: [Error running Gulp] Error: [BABEL] <filelocation>: Unknown option: base.modules
Is there a fix for this?
did you follow the full project setup instructions on the docs page or in the project's readme.md?
Running The App
To run the app, follow these steps.
Ensure that NodeJS is installed. This provides the platform on which the build tooling runs.
From the project folder, execute the following command:
npm install
Ensure that Gulp is installed globally. If you need to install it, use the following command:
npm install -g gulp
Ensure that jspm is installed globally. If you need to install it, use the following command:
npm install -g jspm
Install the client-side dependencies with jspm:
jspm install -y
To run the app, execute the following command:
gulp watch
Browse to http://localhost:9000 to see the app. You can make changes in the code found under src and the
browser should auto-refresh itself as you save files.
I read over one step, which was the npm install command which you have to execute from the project folder. I got some errors that the CL.exe file was missing and after some Googling, I found out that was due to me not having Visual Studio 2013 not installed, which kept the utf-8 validator package from not installing.

webpack-dev-server is not recognized

I get a web pack related error when I try to run "npm run dev" as follows
'webpack-dev-server' is not recognized as an internal or external command,
operable program or batch file.
I've attached the screenshot of the error from the terminal. As well as a screenshot of the generated log.
Log
Could you please check the package.json file whether it is installed or not.
If you find webpack-dev-server present under the development dependencies but still its not working try doing an npm install to reinstall the missing packages.
If not you could simply do
npm install webpack-dev-server --save-dev
executing this would save the package under node modules directory.
you could also configure webpack dev server to a custom command under scripts in package.json
"scripts": {
"start:dev": "webpack-dev-server"
}

Categories