Black#DESKTOP-N04CDRI MINGW64 /c/web devlopment/react-chat-application/chat-application (master)
$ npm start
chat-application#0.1.0 start C:\web devlopment\react-chat-application\chat-application
react-scripts start
Could not find a required file.
Name: index.js
Searched in: C:\web devlopment\react-chat-application\chat-application\src
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! chat-application#0.1.0 start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the chat-application#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\Black\AppData\Roaming\npm-cache_logs\2021-09-29T15_56_51_774Z-debug.log
Black#DESKTOP-N04CDRI MINGW64 /c/web devlopment/react-chat-application/chat-application (master)
$
you may have deleted index.js file or renamed it.if you are using react-create-app pipeline then you can't rename that or remove this file so make sure it's present in your src folder inside project dir and if you are using git then run git status it will tell you what you had changed.
index.html has been moved/removed from the /public directory
Does your project have an index.js file in the public directory?
If not you can get the one that Create React App uses here
Related
I am trying to setup a express.js server using there generator. I have followed the documation and I have succesfully created the basic structure. However if I try to run the given command (SET DEBUG=transcriptverificationserver:* & npm start) to start the server I always get the following error:
npm ERR! Missing script: "start"
npm ERR!
npm ERR! Did you mean one of these?
npm ERR! npm stars # View packages marked as favorites
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\a\AppData\Local\npm-cache\_logs\2022-11-28T22_43_43_285Z-debug-0.log
PS C:\Users\a\Desktop\Verified Transcripts\Webpage> npm start
npm ERR! Missing script: "start"
npm ERR!
npm ERR! Did you mean one of these?
npm ERR! npm star # Mark your favorite packages
npm ERR! npm stars # View packages marked as favorites
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\a\AppData\Local\npm-cache\_logs\2022-11-28T22_45_41_209Z-debug-0.log
I assume its an issue within the package.json file. The script part looks as following:
"scripts": {
"start": "node ./bin/www"
},
I haven´t change anything in the files or structure and I was simply copying the commands from the documentation (https://expressjs.com/en/starter/generator.html)
Thanks for any help in advance
I have tried it again and this time everthing works. I am not sure what has happend before but I might have used the old installation method.
$ npm install -g express-generator
$ express
With my secound try I ensured to use the new method:
$ npx express-generator
I recently switched to using dev.env & test.env for a REST API using Javascript and I'm getting the following error:
$ npm run dev
Error: Failed to find .env file at default paths: [./.env,./.env.js,./.env.json]
at getEnvFile
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! taskr#1.0.0 dev: env-cmd ./config/dev.env nodemon src/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the taskr#1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Is there something I should revise in the way my .env files are stored/accessed?
try:
env-cmd -f ./config/dev.env nodemon src/index.js
This error is shown whenever i try to build the project. Can someone please help me with this
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! covid-19-world#0.1.0 build: react-scripts build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the covid-19-world#0.1.0 build 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\uniqf\AppData\Roaming\npm-cache_logs\2020-09-02T16_41_30_577Z-debug.log
The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command npm run build" terminated with exit code: 1.
You can try the following -
Delete the node_modules folder
Delete the package-lock.json if it exists
run npm install in the terminal
Yes I found the problem and solved it by removing the cache, Doing what SFUE said above and created a new project with all the source code of earlier and I was able to build the project
'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! bookbhandar#0.1.0 start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bookbhandar#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\Laxman\AppData\Roaming\npm-cache_logs\2020-08-22T18_25_37_539Z-debug.log
Can some one help me with this error?
It seems like react-scripts is not installed into your node_modules folder. Try to check if you are running the command on the correct folder and if the react-scripts dependency is in the package.json file.
Otherwise try to delete the node_modules folder and run npm i.
So in my recent project I tried to install some node modules, in this case, express and MySQL, which both return the same error:
npm WARN thecaptain.ga#1.0.0 No repository field.
npm ERR! path C:\Users\user\projectroot\node_modules\on-finished
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\user\projectroot\node_modules\on-
finished' -> 'C:\Users\user\projectroot\node_modules.on-finished.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
I tried to delete all the related files, then reinstalling it, however that did not change anything. I have run npm init before the install even attempted to fill in the dependency manually, to then run npm install. It happens with every node module in any node project I have.
Turns out the issue was because the dropbox tried to synchronize the files as i was installing the package. Pausing or disabling this fixes the issue...
Could you try this please:
1 - Ensure no NPM scripts are running.
2 - Navigate to your project route
3 - Run this command:
rm package-lock.json && npm i
Note - it may also be worth trying to delete your 'node_modules' folder in your project directory and running the above command.