Cannot run "npm run watch", error message brings up "gulp" error - node.js

I am using a web starter kit from coding phase GitHub that normally works fine for me. for some reason when i attempt to run npm run watch it gives me error messages. I'm not 100% positive but I believe this begun when I updated my I did an uninstall and re-install of nodeJS. help me out!
sh: gulp: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! starter-kit-2019#1.1.0 watch: `gulp`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the starter-kit-2019#1.1.0 watch 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! /Users/joseperez/.npm/_logs/2018-12-20T02_45_19_840Z-
debug.log

Its because we are using 'gulp' as a global module. So when you removed node from your system, it removed the gulp which is a package installed.
You can reinstall it by using
`npm install gulp-cli -g`
And it will work!
Update:
He is using a mac so try running this command.
$ npm uninstall --global gulp gulp-cli
$ rm /usr/local/share/man/man1/gulp.1
$ npm install --global gulp-cli`

Hope this info turns out useful to someone after doing research on an error that was coming up on my console stating, "gulp: command not found" I found a link that addresses how to fix this. turns out my gulp was not installing properly because there was an issue with my path. btw I am using a Mac machine below is the link that helped me out!
here is the link that helped me out!

Related

NextJS not running on MacOS even after installing modules

So I've just created a NextJS project using create-next-app which went smoothly as expected. Then ran npm i just to be sure and saw all modules installed into node_modules
When I try to run npm run dev to start my nextjs app. it just says
sh: next: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! test#0.1.0 dev: `next dev`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the test#0.1.0 dev 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! /Users/john.v.n.pakson/.npm/_logs/2022-10-06T08_01_29_725Z-debug.log
It seems like npm is not detecting the node_modules i have installed.
Not sure if this is a mac or a zsh issue.
I'm using node version 12.22.12
Upgraded to 16.17.1 and still see the same error
> test#0.1.0 dev
> next dev
/var/folders/6y/xtlzp4z16dj0stxnqx8znj8w0000gn/T/dev-01c08137.sh: line 1: next: command not found
Okay I figured it out. It was caused by my file path on macos. My project was on a folder called Project/Test which might have confused zsh or mac. This in turn caused npm to not be able to find the correct scripts on my node_modules
When I moved my project to another folder I was already able to run npm run dev properly.
Cheers!

npx start, npx install npx init is not working

I have been working with react for years using NPX and yarn and I just got assign to built an app with react-native using react native-cli so i tried setting up my environment using the react native docs and some YouTube videos. But after following the instructions like downloading android studios and adding in my new environment variable, I'm getting an error every time i tired to run
"npx react-native init AwesomeProject" which gave me this error
[![npx react-native init result][1]][1]
I also tried npm install and i got this error on git bash and also on my commandline
npm ERR! syscall spawn bash
npm ERR! path C:\Users\Dennis\Desktop\GitHub\LCRN01-travel-onboarding-app-master\LCRN01-travel-onboarding-app-master\node_modules\core-js
npm ERR! errno -4058
npm ERR! enoent spawn bash ENOENT
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:
npm ERR! C:\Users\Dennis\AppData\Local\npm-cache\_logs\2021-11-13T05_50_35_592Z-debug.log```
and also npx react-native start is showing this error on git bash
```openssl config failed: error:02001003:system library:fopen:No such process
Command `start` unrecognized. Make sure that you have run `npm install` and that you are inside a react-native project.```
I have tried running "npm cache clean --force"
but still nothing changed
I can't even run npx create-react-app anymore because i keep getting this error
npx creat-react-app test
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/creat-react-app - Not found
npm ERR! 404
npm ERR! 404 'creat-react-app#latest' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Dennis\AppData\Local\npm-cache_logs\2021-11-13T06_05_46_068Z-debug.log
I'm currently using a windows 10 device
node -v 16.13.0
npm -v 8.1.3
[1]: https://i.stack.imgur.com/OTLYj.png
It's create-react-app.
Not totally sure but another issue could be that your Git bash isn't in your PATH.
Plus, npx start and npx install doesn't sound right, maybe you meant npm start and npm install.
On top of that, it seems you have node v11 and not node v16, maybe you have different versions of node, some in Windows' PATH and some only accessible from bash.
It could help to clean up and reinstall your node versions and Git bash, also check your environment variables for remnants of previous versions, and make sure to not confuse npm and npx.

react-scripts: command not found (npm start)

I've been using create-react-app without issues for some time, but recently, after running it, I cannot start the development server. After running npm start, I get the following error:
sh: react-scripts: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! js-calculator#0.1.0 start: `react-scripts start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the js-calculator#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Scripts appear to be in the correct location and correctly configured in the package.json file.
Also, npm start throws me the same error if I run it in other react-apps folders that used to work before.
I tried various suggestions I found here on stackoverflow:
installing create-react-app globally;
reinstalling dependencies (npm install);
reinstalling react scripts (npm install react-scripts --save);
updating node and npm;
but none of the above worked.
Any suggestions?
I've also a more detailed .log file, in case anyone wants to have a look at it.
After many tries and more reading of related issues here on SO, I found the cause. One of my react-app parent folders (five levels above) name was "example/example"; naming it to "example-example" solved the problem.

laravel 8 instalation error - npm run dev throws error

I am trying to install a fresh laravel 8 project. After downloading frontend scaffolding when I try to run npm run dev it gives me an error. This problem also happens during installing jetstream in this npm run dev. I am giving error below.
unkno#DESKTOP-NAP4DRR MINGW64 /c/laravel projects/example
$ npm run dev
> # dev C:\laravel projects\example
> npm run development
> # development C:\laravel projects\example
> mix
[webpack-cli] Running multiple commands at the same time is not possible
[webpack-cli] Found commands: 'bundle', 'projects\example\node_modules\laravel-mix\setup\webpack.config.js'
[webpack-cli] Run 'webpack --help' to see available commands and options
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! # development: `mix`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the # development 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\unkno\AppData\Roaming\npm-cache\_logs\2021-01-09T03_39_54_620Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! # dev: `npm run development`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the # dev 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\unkno\AppData\Roaming\npm-cache\_logs\2021-01-09T03_39_54_704Z-debug.log
I experienced the same problem a few weeks ago. What I figured out was that on windows that instead of running the command npm install && npm run dev it needed to be npm install and npm run-dev.
Also make sure you have the latest node and npm versions install. Perform a npm audit fix as well to fix any vulnerabilities.
I can see you are a Windows developer, and that you have spaces in the name of your project folder. Windows, spaces and nodejs don't like to behave very nicely together.
Try removing the spaces from name of your project path and see if this addresses the issue for you.
Update: As per a similar question, Laravel, error when running npm run dev on fresh new installation, this solved the users issue.
Try doing a full reset:
rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install
It works for me, on Laravel 9
Thanks to Sir Jeffrey Way

npm install always gives 'Your cache folder contains root-owned files, due to a bug in npm previous versions of npm which has since been addressed.'

I am currently using Ubuntu 18.04.4 and I am trying to install something using npm install but it always gives the error below. I tried other aliases as well (npm i, npm add) but the error persists.
npm install
npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path /home/dell/.npm/_cacache/content-v2/sha512/14/21/2143fe2b135cd8bfdad85c9c3f9ac46ab279a58dee631cfea1b9678167bd388d44f2d36739019c96ba3a4c4756b1ea6570f4dc8931fb8ad8230359521f80
npm ERR! errno -1
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR! sudo chown -R 1001:1001 "/home/dell/.npm"
npm ERR! A complete log of this run can be found in:
npm ERR! /home/dell/.npm/_logs/2020-07-30T17_16_58_257Z-debug.log
When I run the sudo chown -R 1001:1001 "/home/dell/.npm" command, it does nothing, and the error remains when I run npm install again. I have also searched StackOverflow and other platforms for the answer, but no solution seems to solve this problem.
P.S: My node version is 12.18.3 and npm version is 6.14.6.
If someone can help me resolve this, I would really appreciate it!
I had problem with create-react-app. Solve it using yarn.
yarn global remove create-react-app
then
yarn global add create-react-app
and
create-react-app MyApp

Resources