node-react-ecommerce icon indicating copy to clipboard operation
node-react-ecommerce copied to clipboard

Iam not able to run your project in windows 64bit os

Open kissu12345 opened this issue 5 years ago • 7 comments

backend server started but frontend not working iam getting this error in localhost browser kindly give suggesstion.

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined at validateString (internal/validators.js:121:11) at Object.join (path.js:375:7) at noopServiceWorkerMiddleware (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\react-dev-utils\noopServiceWorkerMiddleware.js:14:26) at Layer.handle [as handle_request] (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\index.js:317:13) at C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\index.js:284:7 at Function.process_params (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\index.js:335:12) at next (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\index.js:275:10) at launchEditorMiddleware (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\react-dev-utils\errorOverlayMiddleware.js:20:7) at Layer.handle [as handle_request] (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\index.js:317:13) at C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\index.js:284:7 at Function.process_params (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\index.js:335:12) at next (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\index.js:275:10) at handleWebpackInternalMiddleware (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\react-dev-utils\evalSourceMapMiddleware.js:42:7) at Layer.handle [as handle_request] (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\layer.js:95:5)

kissu12345 avatar Jun 12 '20 07:06 kissu12345

It means there is wrong path and in Route in App.js Compare your code with mine to fix the issue

On Fri, Jun 12, 2020 at 12:11 PM kissu12345 [email protected] wrote:

backend server started but frontend not working iam getting this error in localhost browser kindly give suggesstion.

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined at validateString (internal/validators.js:121:11) at Object.join (path.js:375:7) at noopServiceWorkerMiddleware (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\react-dev-utils\noopServiceWorkerMiddleware.js:14:26) at Layer.handle [as handle_request] (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\index.js:317:13) at C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\index.js:284:7 at Function.process_params (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\index.js:335:12) at next (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\index.js:275:10) at launchEditorMiddleware (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\react-dev-utils\errorOverlayMiddleware.js:20:7) at Layer.handle [as handle_request] (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\index.js:317:13) at C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\index.js:284:7 at Function.process_params (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\index.js:335:12) at next (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\index.js:275:10) at handleWebpackInternalMiddleware (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\react-dev-utils\evalSourceMapMiddleware.js:42:7) at Layer.handle [as handle_request] (C:\Users\kishan and vijji\Desktop\node-react-ecommerce-master\frontend\node_modules\express\lib\router\layer.js:95:5)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/basir/node-react-ecommerce/issues/44, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATUFQ4TABJ4SYTR4V3FDCTRWHL33ANCNFSM4N4CVUPA .

basir avatar Jun 12 '20 08:06 basir

iam tried to run ur code also it showed same error how to resolve this how to change path in app.js

kissu12345 avatar Jun 12 '20 09:06 kissu12345

share App.js please

basir avatar Jun 16 '20 07:06 basir

import React from 'react'; import { BrowserRouter, Route, Link } from 'react-router-dom' import './App.css'; import HomeScreen from './screens/HomeScreen1'; import ProductScreen from './screens/ProductScreen1'; import CartScreen from './screens/CartScreen'; import SigninScreen from './screens/SigninScreen'; import { useSelector } from 'react-redux'; import RegisterScreen from './screens/RegisterScreen'; import ProductsScreen from './screens/ProductsScreen'; import ShippingScreen from './screens/ShippingScreen'; import PaymentScreen from './screens/PaymentScreen'; import PlaceOrderScreen from './screens/PlaceOrderScreen'; import OrderScreen from './screens/OrderScreen'; import ProfileScreen from './screens/ProfileScreen'; import OrdersScreen from './screens/OrdersScreen';

function App() {

const userSignin = useSelector(state => state.userSignin); const { userInfo } = userSignin;

const openMenu = () => { document.querySelector(".sidebar").classList.add("open"); } const closeMenu = () => { document.querySelector(".sidebar").classList.remove("open") } return ( <BrowserRouter> <div className="grid-container"> <header className="header"> <div className="brand"> <button onClick={openMenu}> ☰ <Link to="/" >amazona</Link> <div className="header-links"> Cart { userInfo ? <Link to="/profile">{userInfo.name}</Link> : <Link to="/signin">Sign In</Link> } {userInfo && userInfo.isAdmin && ( <div className="dropdown"> Admin <ul className="dropdown-content">

  • <Link to="/orders">Orders</Link> <Link to="/products">Products</Link>
  • )} <aside className="sidebar">

    Shopping Categories

    <button className="sidebar-close-button" onClick={closeMenu}>x <ul className="categories">
  • <Link to="/category/Pants">Pants</Link>
  •         <li>
              <Link to="/category/Shirts">Shirts</Link>
            </li>
    
          </ul>
        </aside>
        <main className="main">
          <div className="content">
            <Route path="/orders" component={OrdersScreen} />
            <Route path="/profile" component={ProfileScreen} />
            <Route path="/order/:id" component={OrderScreen} />
            <Route path="/products" component={ProductsScreen} />
            <Route path="/shipping" component={ShippingScreen} />
            <Route path="/payment" component={PaymentScreen} />
            <Route path="/placeorder" component={PlaceOrderScreen} />
            <Route path="/signin" component={SigninScreen} />
            <Route path="/register" component={RegisterScreen} />
            <Route path="/product/:id" component={ProductScreen} />
            <Route path="/cart/:id?" component={CartScreen} />
            <Route path="/category/:id" component={HomeScreen} />
            <Route path="/homescreen" exact={true} component={HomeScreen} />
    
    
          </div>
    
        </main>
        <footer className="footer">
          All right reserved.
    </footer>
      </div>
    </BrowserRouter>
    

    ); }

    export default App;

    kissu12345 avatar Jun 17 '20 06:06 kissu12345

    iam nt able to send app.js file

    kissu12345 avatar Jun 17 '20 06:06 kissu12345

    You need to update your react-scripts. See: https://github.com/basir/node-react-ecommerce/issues/32#issuecomment-640289110

    Also(this is unrelated) if you want to see the products you will need to import the data into MongoDB in the appropriate JSON format. If it doesn't already exist create an amazona database. Then either create a products collection or just create it automatically by importing. Be sure to remove the id field from the JSON objects in your json file before importing so MongoDB can assign its own ids.

    hjrobinson avatar Jul 08 '20 22:07 hjrobinson

    hello there I just updated the run locally docs. check it now to fix the issue: https://github.com/basir/node-react-ecommerce#run-locally

    basir avatar Jul 27 '20 04:07 basir