0

I am trying to develeop SAPUI5 / OpenUI5 SPA application as Node.js application and there is my package.json file:

{
  "name": "societyaleph",
  "version": "1.0.0",
  "description": "Society Aleph",
  "main": "index.js",
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "author": "TomR",
  "license": "ISC",
  "dependencies": {
    "@openui5/sap.f": "^1.75.0",
    "@openui5/sap.m": "^1.75.0",
    "@openui5/sap.tnt": "^1.75.0",
    "@openui5/sap.ui.codeeditor": "^1.75.0",
    "@openui5/sap.ui.commons": "^1.75.0",
    "@openui5/sap.ui.core": "^1.75.0",
    "@openui5/sap.ui.demokit": "^1.72.1",
    "@openui5/sap.ui.documentation": "^1.75.0",
    "@openui5/sap.ui.dt": "^1.75.0",
    "@openui5/sap.ui.fl": "^1.75.0",
    "@openui5/sap.ui.integration": "^1.75.0",
    "@openui5/sap.ui.layout": "^1.75.0",
    "@openui5/sap.ui.rta": "^1.75.0",
    "@openui5/sap.ui.suite": "^1.75.0",
    "@openui5/sap.ui.support": "^1.75.0",
    "@openui5/sap.ui.table": "^1.75.0",
    "@openui5/sap.ui.testrecorder": "^1.75.0",
    "@openui5/sap.ui.unified": "^1.75.0",
    "@openui5/sap.ui.ux3": "^1.75.0",
    "@openui5/sap.uxap": "^1.75.0",
    "@openui5/themelib_sap_belize": "^1.75.0",
    "@openui5/themelib_sap_bluecrystal": "^1.75.0",
    "@openui5/themelib_sap_fiori_3": "^1.75.0",
    "@openui5/ts-types": "^1.60.5"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ]
}

I am following the OpenUI5 guidelines and Quickstart application and hence in my root directory I have only package.json and package-lock.json files, but I have webapp directory with the index.html, index.js, WebApp.controller.js, WebApp.view.xml. So - I have no src directory with index.js and no public directory with index.html (as I have for other Node.js applications like React.js applications which I can run successfully as Node.js applications using npm run).

Currently my npm run gives output:

Lifecycle scripts included in societyaleph:
  start
    react-scripts start
  test
    react-scripts test

available via `npm run-script`:
  build
    react-scripts build
  eject
    react-scripts eject

But I expected that Node.js server will be started, application loaded and available on some port. Why this is not happening? Should I add something to my package.json file? But my React applications have almost similar, very simple package.json files (with different libraries, of course)?

npm start gives:

'react-scripts' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! societyaleph@1.0.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the societyaleph@1.0.0 start 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:

So - maybe I should add React dependencies? Is it so hard to convert simple SPA HTML+JavaScript codes as Node.js application?

TomR
  • 2,696
  • 6
  • 34
  • 87

1 Answers1

1

Use the official UI5 tooling to start an express-based development server or bundle your application for productive use.

Johann Goltz
  • 156
  • 5