How to change location of index.js - npm

I'm trying to re arrange a project repo from this:
public/
src/
|
|---- index.js
package.json
To this:
public/
frontend/
|
|---- src/
|
|---- index.js
package.json
When I rearranged, npm start would fail with this message:
Could not find a required file.
Name: index.js
Searched in: /Users/sahandzarrinkoub/Documents/Programming/DH2642/Sentify/repo/Sentify/Sentify/src
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Sentify#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Sentify#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
So I went into the package.json file and added this:
"main": "frontend/src/index.js",
What's strange is that nothing changes. npm tells me that it's still looking in the same directory for index.js.
Could not find a required file.
Name: index.js
Searched in: /Users/sahandzarrinkoub/Documents/Programming/DH2642/Sentify/repo/Sentify/Sentify/src
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sentify#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sentify#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
How can I successfully rearrange my project into this organisation? How can I tell npm where to look for index.js?
I also tried:
"main": "/Users/sahandzarrinkoub/Documents/Programming/DH2642/Sentify/repo/Sentify/Sentify/frontend/src/index.js",

Related

I don't know what going on

I just want to know what is going, whenever I download some react code from github (because I want to check the output for inspiration) and run it using npm start, I see this in the terminal.
What should I do?
sh: react-scripts: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! todo-react#0.1.0 start: `react-scripts start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the todo-react#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/markcornejo/.npm/_logs/2021-05-20T09_35_52_922Z-debug.log
Marks-Air:todo-react-master markcornejo$
Run npm install before npm start, to ensure all the dependencies are installed.

Local package.json exists, but node_modules missing, did you mean to install?

I am trying to clone and use pix/pix in my laptop for a university project
(https://github.com/1024pix/pix). But I am getting the following error:
H:\Bachelor YGREC - Modelling & Data Science\Bachelor Year 1\Project\Project 2\pix>npm run configure
> pix#2.116.0 configure H:\Bachelor YGREC - Modelling & Data Science\Bachelor Year 1\Project\Project 2\pix
> npm install && run-s ci:all test configure:api
> pix#2.116.0 preinstall H:\Bachelor YGREC - Modelling & Data Science\Bachelor Year 1\Project\Project 2\pix
> test "$(npm --version)" = 6.13.4
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pix#2.116.0 preinstall: `test "$(npm --version)" = 6.13.4`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pix#2.116.0 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-02-24T10_36_42_126Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pix#2.116.0 configure: `npm install && run-s ci:all test configure:api`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pix#2.116.0 configure script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-02-24T10_36_42_183Z-debug.log
You should have found the answer by now but if someone else find it useful, just run npm install in your console.
Write npm start in the terminal followed by npm install. This will solve your issue.

Problems with npm errors

I have a problem with create-react-app. When I type npm start into my console it show's multiple errors. I installed the newest version of node and webpack, and also do everything from this link.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! new-app#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the new-app#0.1.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:
npm ERR! C:\Users\Sakuy\AppData\Roaming\npm-cache\_logs\2018-10-02T20_14_18_618Z-debug.log
Have you installed react-scripts globally?.
It might be worth checking this previous post

How to publish a npm package from a owned Github repository?

Im'trying to publish a npm package from a owned Github repository. I've tried with:
npm publish git+https://Aminta#github.com/Aminta/fontfacegen.git
But it gives the following error:
Darwin 17.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v6.11.2
npm ERR! npm v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! fontfacegen#0.3.1-b build: `babel src --out-dir lib`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the fontfacegen#0.3.1-b build script 'babel src --out-dir lib'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the fontfacegen package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! babel src --out-dir lib
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs fontfacegen
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls fontfacegen
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Please include the following file with any support request:
[etc]
Any hints? Thanks!
You could publish from your local github directory. Just clone your repo and do npm publish from that directory.
Here's what npm says:
npm publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>]
Publishes '.' if no argument supplied
Sets tag `latest` if no --tag specified

Why npm start is not working and giving the following error messages:

I have one question regarding npm. Whenever I start npm, it gives the following error:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pomodorclock#1.0.0 start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pomodorclock#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
You first need to run npm install before you can build the package. After you can use npm start.