After running yarn, get fsevents command failed after Mac book update - react-native

After MacBook updated to v12.4 when I try to run yarn command on my react native project I get this error:
error /Users/jaugustinus/Documents/Dev/Service-Bay/node_modules/fsevents: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: /Users/jaugustinus/Documents/Dev/Service-Bay/node_modules/fsevents
Output:
node:events:505
throw er; // Unhandled 'error' event
^
Error: spawn node-gyp ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn node-gyp',
path: 'node-gyp',
This command was running fine yesterday and the only change would be Mac OS update.
Tried also running
rm -rf node_modules
yarn cache clean
yarn
and still got the same error

The error I got was when using node version 16.15.0
If I change the node version to 17.8.0 then I am able to run yarn with no issues.

Related

Azure Pipeline build error Npm failed with return code: 4294963238

I am getting NPM error when I am trying to build the solution as follows
144812 error Windows_NT 10.0.17763
144813 error argv "C:\\hostedtoolcache\\windows\\node\\6.17.1\\x64\\node.exe" "C:\\hostedtoolcache\\windows\\node\\6.17.1\\x64\\node_modules\\npm\\bin\\npm-cli.js" "install"
144814 error node v6.17.1
144815 error npm v3.10.10
144816 error path D:\a\45\s\Presentation Tier\VendorPortal.Web.UI\node_modules\.staging\#types\node-b1eb4de5\package.json
144817 error code ENOTDIR
144818 error errno -4058
144819 error syscall open
144820 error ENOENT: no such file or directory, open 'D:\a\45\s\Presentation Tier\VendorPortal.Web.UI\node_modules\.staging\#types\node-b1eb4de5\package.json'
144821 error If you need help, you may report this error at:
144821 error <https://github.com/npm/npm/issues>
144822 verbose exit [ -4058, true ]
##[error]Error: Npm failed with return code: 4294963238
I tried delete package-lock.json, npm cache clean command, npm install npm#latest -g everything. But I am still getting the error. Error occurs in NPM install step.

Unable to "npm install"

Please could I ask for help with the following:
I have cloned the Electron starter app like so:
git clone https://github.com/electron/electron-quick-start
And have it running.
I am working from the terminal window is VSCode.
I am using node version 6.13.4
Can type "npm start" and all is good, app runs fine.
Now, I want to use a certain package for working with zip files, so I try the following:
npm install decompress-zip
The result is ultimately an error, here's the output:
PS C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip> npm install decompress-zip
> electron#16.0.5 postinstall C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\electron
> node install.js
RequestError: self signed certificate in certificate chain
at ClientRequest.<anonymous> (C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\got\source\request-as-event-emitter.js:178:14)
at Object.onceWrapper (events.js:428:26)
at ClientRequest.emit (events.js:333:22)
at ClientRequest.origin.emit (C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\#szmarczak\http-timer\source\index.js:37:11)
at TLSSocket.socketErrorListener (_http_client.js:426:9)
at TLSSocket.emit (events.js:321:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
npm WARN rollback Rolling back debug#2.6.9 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\extract-zip\node_modules'npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron#16.0.5 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron#16.0.5 postinstall 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\105043131\AppData\Roaming\npm-cache\_logs\2022-01-05T11_15_47_499Z-debug.log
Now the build is broken. If try again "npm start" then I get:
PS C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip> npm
start
electron-quick-start#1.0.0 start C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip
electron .
internal/modules/cjs/loader.js:984 throw err; ^
Error: Cannot find module 'C:\Work\Electron
Apps\electron-quick-start-added-fs-and-zip\node_modules\electron\cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:981:15)
at Function.Module._load (internal/modules/cjs/loader.js:863:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } npm ERR! code ELIFECYCLE npm
ERR! errno 1 npm ERR! electron-quick-start#1.0.0 start: electron .
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the
electron-quick-start#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: npm ERR!
C:\Users\105043131\AppData\Roaming\npm-cache_logs\2022-01-05T11_18_31_473Z-debug.log
Makes no difference now if I run "npm uninstall decompress-zip", I still get the same error when I try "npm start".
This line from the above caught my eye:
npm ERR! Failed at the electron#16.0.5
If I start completely over an try installing another package instead like so:
npm install yauzl
I get similar errors including the line:
npm ERR! Failed at the electron#16.0.5 postinstall script.
I currently have electron 8.1.1 installed
Could it be that these packages require electron 16?
Or is it something else?
If it is the former, would anyone know of a solution for unzipping a disk file using an older version of electron?
Thanks for any help.
the best way is to update Node.js. Uninstall old version then go to https://nodejs.org/en/download/ and download LTC version

metro boundler does not work - expo/react native

I want to run a react native app by those commands:
npm i -g expo-cli
expo init myapp
cd myapp
npm start
but I get the following error and the metro boundler not work:
Opening DevTools in the browser... (press shift-d to disable)
Error: spawn powershell ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # start: `expo start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # 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\nathan-hp\AppData\Roaming\npm-cache\_logs\2020-09-22T14_48_10_269Z-debug.log
I added this to the path:
C:\Windows\System32
but I still get the error above
ok, that was the solution:
the problem was:
Error: spawn powershell ENOENT
so I need to add:
C:\Windows\System32\WindowsPowerShell\v1.0
to the path.
I openned Windows PowerShell as admin and run:
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
run npm start again in the cmd and then metro boundler was openned
I did that commands yesterday but somehow it didnt work, guess I have missed something.
The full explanation can be found here:
https://www.youtube.com/watch?reload=9&v=nfX7HtNiCZI

How can i handle ‘Exit status 1’ during react server start

I am implementing react app.
My environment is in intranet with no internet access.
So, I set react project in outside environment with internet access.
After copying project to intranet environment, I executed npm install and start.
But a error has occurred during starting below.
PS D:\workspaces\my-app> npm start
> my-app#0.1.0 start D:\workspaces\my-app
> react-scripts start
i 「wds」: Project is running at http://10.225.168.119/
i 「wds」: webpack output is served from
i 「wds」: Content not from webpack is served from D:\workspaces\my-app\public
i 「wds」: 404s will fallback to /
Starting the development server...
events.js:292
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs: [ '/s', '/c', 'start', '""', '/b', '"http://localhost:3000/"' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-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\KTDS\AppData\Roaming\npm-cache\_logs\2020-07-02T02_03_07_566Z-debug.log
This project is working fine in outside env.
Is the solution to this issue?

Enoent error when trying to create React App

I'm trying to create react-app but I'm having a ENOENT problem, this is what the command prompt shows:
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
events.js:186
throw er; // Unhandled 'error' event
^
Error: spawn C:\Windows\system32\cmd.exe; ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess.cp.emit (C:\Users\Pedro Fernando\AppData\Roaming\npm\node_modules\create-react-app\node_modules\cross-spawn\lib\enoent.js:34:29)
at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn C:\\Windows\\system32\\cmd.exe;',
path: 'C:\\Windows\\system32\\cmd.exe;',
spawnargs: [
'/d',
'/s',
'/c',
'"npm ^"install^" ^"--save^" ^"--save-exact^" ^"--loglevel^" ^"error^" ^"react^" ^"react-dom^" ^"react-scripts#0.9.x^""'
]
}
Does anyone had this problem and was able to fix it?
Before anyone asks:
These are my system variables path
Windows System Variables Path
Please, try the following inside your terminal:
First remove all node_modules: rm -fr node_modules/
followed by:
npm install npm#latest -g
npm install -g create-react-app
npm init react-app my-app
Try to change react-scripts version to 2.1.8. This worked for me.
I've come across this issue a few times. Usually it's solved by restarting the computer.