Grunt: Fatal Error: spawn cmd ENOENT - javascript

I am trying to start Grunt on Windows, but getting an error: Fatal error: spawn cmd ENOENT. I've installed Git and NodeJS, and then ran the following:
npm install -g bower grunt-cli cordova
npm install
bower install
grunt build
grunt serve
I then tried:
clearing the cache from npm (npm cache clean)
reinstalled npm
adding C:\Windows\Systems32\; to the path variable.
But I can't get it to work.

Related

ENOENT (error -4058) during create-react-app

when i type npm command create-react-app my-app i have error like this :
npm ERR! code ENOENT
npm ERR! syscall spawn C:\Windows\System32;
npm ERR! path C:\Users\Administrator\Documents\th-wedding\template
npm ERR! errno -4058
npm ERR! enoent spawn C:\Windows\System32; 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\Administrator\AppData\Local\npm-cache\_logs\2023-02-02T04_41_46_601Z-debug-0.log
I've tried every way, from setting up the env, and reinstalling with a different version, but still the error
ENOENT means There is no directory exists with this name
Now You need to check several points:
Check the version of node js & npm (check version installed is proper)
remove cache (npm cache clean --force or npm cache clean)
verify removed cache (npm cache verify --force or npm cache verify)
check the installed version or install the new version or re-install again of react react-dom react-scripts using (npm install --save react create-react-app)
then create a new app using npx create-react-app app-name
Of If your project is already created then install necessary dependencies using (npm install)

Unable to install `#nuxtjs/sentry` in Node 16.14 docker container. Permission errors

I'm trying to install #nuxtjs/sentry using npm install #nuxtjs/sentry. These are the errors I'm getting.
npm ERR! code 1
npm ERR! path /app/node_modules/#sentry/cli
npm ERR! command failed
npm ERR! command sh -c node ./scripts/install.js
npm ERR! info sentry-cli Downloading from https://downloads.sentry-cdn.com/sentry-cli/1.74.4/sentry-cli-Linux-x86_64
npm ERR! Error: EACCES: permission denied, mkdir '/root/.npm/sentry-cli'
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-06-24T08_02_47_860Z-debug-0.log
exited with code 1
You probably need to use unsafe-perm
either:
add a file called .npmrc in your project's root directory and put this in it
unsafe-perm=true
OR
just use this command before installing (I didn't confirm this)
sudo npm config set unsafe-perm true
Basically npm would download the packages as root but then try to install the binaries as a local user without root permissions so it wouldn't have access to the directory where the binaries were downloaded at.
You just better double check the packages that you install to make sure they are trustworthy, otherwise it's safe to do so
Note: I only tried it on node 14, didn't test it on node 16

Error : create-react-app Aborting installation

according to Reactjs docs :
Youโ€™ll need to have Node >= 8.10 and npm >= 5.6 on your machine. To create a project, run:
npx create-react-app my-app
which my env meet it:
AymanMorsy#DESKTOP-6V4567D MINGW64 /g/reactprojects
$ node --version && npm --version ๐Ÿ‘ˆ๐Ÿ‘ˆ
v12.16.0 ๐Ÿ‘ˆ๐Ÿ‘ˆ
6.13.4 ๐Ÿ‘ˆ๐Ÿ‘ˆ
AymanMorsy#DESKTOP-6V4567D MINGW64 /g/reactprojects
$ npx create-react-app my-app
npx: installed 99 in 17.908s
Creating a new React app in G:\reactprojects\my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz
npm ERR! 404
npm ERR! 404 'error-ex#^1.3.1' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'parse-json'
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\AymanMorsy\AppData\Roaming\npm-cache\_logs\2020-02-12T21_29_30_123Z-debug.log
Aborting installation. ๐Ÿšจ๐Ÿšจ๐Ÿšจ
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting my-app/ from G:\reactprojects
Done.
I tried solutions on Create React App not installing, showing an error and aborting installation
finally I formated C and installed latest update of windows10 and still see the same problem
edite: output of npm config list
$ npm config list
; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.13.4 node/v12.16.0 win32 x64"
; builtin config undefined
prefix = "C:\\Users\\AymanMorsy\\AppData\\Roaming\\npm"
; node bin location = C:\Program Files\nodejs\node.exe
; cwd = G:\reactprojects
; HOME = C:\Users\AymanMorsy
; "npm config ls -l" to show all defaults.
Looks like https://registry.npmjs.org/error-ex is down for some regions
It will be soon up
solution for this following โคต
Install Scoop
and then install
yarn and then do yarn create-react-app myapp100% work definitely
In my case, antivirus was stopping some of the modules from being accesses. Turned it off, also installed yarn. Works fine
Stop Antivirus momentarily.
npm install -g yarn
yarn global add create-react-app
npx create-react-app my-app
Start Antivirus
Although I feel that yarn is not mandatory to solve this issue in my case - I prefer yarn.
Hoping this helps someone out there.

Unable to install node modules because 'This is related to npm not being able to find a file.'

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.

NPM installing package ENOENT Error

I have installed npm on my Laravel Project.
When I run npm install --save vue-draggable
I get this error
ENOENT: no such file or directory, rename '/Users/victori/Desktop/project-1/node_modules/npm/node_modules/dezalgo
Although, when I run npm install -g --save vue-draggable it works. Although, id want it onto my actual project files.
NPM Verson: 5.6.0
Node: v8.9.1

Categories