problems running npx expo start - node.js

i'm trying to start a project using "npx expo start" but i'm getting the same error, i don't know how to solve it. This error started after the new expo update to SDK 46, I already tried to start new projects following the documentation step-by-step, but I keep getting the same error. My operating system is linux.
Error: EISDIR: illegal operation on a directory, read
Error: EISDIR: illegal operation on a directory, read
at Object.readSync (node:fs:748:3)
at tryReadSync (node:fs:448:20)
at Object.readFileSync (node:fs:494:19)
at readPackageJSON (/home/ronaldfleetss/expo2/my-app/node_modules/find-yarn-workspace-root/index.js:50:26)
at findWorkspaceRoot (/home/ronaldfleetss/expo2/my-app/node_modules/find-yarn-workspace-root/index.js:23:22)
at getWorkspaceRoot (/home/ronaldfleetss/expo2/my-app/node_modules/#expo/metro-config/build/getModulesPaths.js:34:49)
at getWatchFolders (/home/ronaldfleetss/expo2/my-app/node_modules/#expo/metro-config/build/getWatchFolders.js:124:65)
at getDefaultConfig (/home/ronaldfleetss/expo2/my-app/node_modules/#expo/metro-config/build/ExpoMetroConfig.js:253:63)
at Object.loadAsync (/home/ronaldfleetss/expo2/my-app/node_modules/#expo/metro-config/build/ExpoMetroConfig.js:352:23)
at Object.instantiateMetroAsync (/home/ronaldfleetss/expo2/my-app/node_modules/#expo/cli/build/src/start/server/metro/instantiateMetro.js:27:45)
I need help, I've tried to make several changes in the application, I've also tried to enter the node's default folder and give all possible permissions, but I don't know if the error is in the expo or in nodejs.
making some observations I've already uninstalled the global expo, I've also made changes to the package.json as requested in the expo documentation. I've also tried running npm install to update the new changes, but with no success.

Related

Unknown error, watch at FSEvent.FSWatcher._handle.onchange (node: internal/fs/waters:204:211)

I am getting this error when I try to run gulp serve on a webpart that I generated through SPFx. I am on Windows 10 (Server 2019), using node v16.16.0, watchman v20220807.195202.0
I have tried generating the webpart with no framework and react. Same error both times. I have set the cert, installed watchman as admin, reinstalled watchman.
I updated the serve.json file to point to my tenant. I really don't know what else to try and I really don't understand much about this. I was following the instructions in this video (https://www.youtube.com/watch?v=6WTtjXP5yW4&list=PLR9nK3mnD-OXvSWvS2zglCzz4iplhVrKq&index=3).
I set up the dev environment based on the previous video (https://www.youtube.com/playlist?list=PLR9nK3mnD-OXvSWvS2zglCzz4iplhVrKq) and that seemed to go well. I was doing ok with the webpart until trying to deploy the webpart.
Error: UNKNOWN: unknown error, watch
at FSEvent.FSWatcher._handle.onchange (node:internal/fs/watchers:204:21)
at FSEvent.callbackTrampoline (node:internal/async_hooks:130:17)
About to exit with code: 1

Can't create a react native empty project, app.json not found

I am currently trying to get started with react native.
I set up the development environment referring to the documentation, but can't even pass the first step and create an empty project.
I am on Windows 11, Node 16.15.1, and NPM 8.12.2
I keep getting the following error when trying to init react-ative project with expo init awesomeProject
Error downloading and extracting template package: Error: npm exited with non-zero code: 1
× Something went wrong while downloading and extracting the template.
Can't read JSON file: D:\crna\awesomeProject\app.json
└─ Cause: Error: ENOENT: no such file or directory, open 'D:\crna\awesomeProject\app.json'
Does anyone has a suggestion ?
Don't really know what is the problem but i found a soluion that might help other people in the same situation as me! like said here just run in CMD instead of GitBash
Use sudo if on linux. And maybe Admin on windows.

angular project npm modules randomly deleted

I have the weirdest problem I've ever seen with npm where in the middle of running an angular ng serve, packages from both node and for angular will randomly go missing. In the middle of a save, the project will suddenly not recompile, and will complain about a missing module. Each time it has been different but so far I have had:
Error: ENOENT: no such file or directory, open '.../node_modules/core-js/internals/hidden-keys.js'
Module not found: Error: Can't resolve '../internals/is-pure' in '/.../node_modules/#angular-devkit/build-angular/node_modules/core-js/internals'
An unhandled exception occurred: Cannot find module './internal/streams/stream
An unhandled exception occurred: Cannot find module '/.../node_modules/minipass-collect/node_modules/minipass/index.js'.
Please verify that the package.json has a valid "main" entry
These have just been errors from the last few days, but issues like this has been happening all. to the point where I need to delete node_modules and reinstall everything via npm at least once a day. I'm thinking the error has more to do with node or NPM than with my Angular set up, as some of these missing packages appear to be node core packages.
I've already tried reinstalling npm globally via npm install -g npm and it hasn't helped anything. I'm afraid that I'm going to have to just reinstall node completely.
Any help would be appreciated, thank you.
EDIT: upon further debugging, I'm noticing that the modules missing are always from #angular-devkit/build-angular/node_modules/core-js/modules. In addition to losing random modules like 'is-pure', the app will also randomly recompile many times when running ng serve
I figured out what was going on, if anyone in the future has the same problem. Turns out the answer has nothing to do with me botching my npm config. I didn't realize that on new Macbooks, any directory in the desktop is automatically managed by iCloud. At some point, probably an older version of the code before I migrated to Angular 9 was syncing the old code into my project. I was able to resolve this issue by changing the name of the parent directory where my project lived from filename to filename.nosync. adding '.nosync' causes iCloud to ignore syncing for whatever is in that file. I know I should have caught this, but hopefully this will help any mac users in the future who are experiencing similar problems.

Getting error when deploying a Google Cloud Function after Node upgrade

I updated Brew then updated Node from 10.12.0 -> 13.8.0
Now, I get the following error when trying to deploy a Google Cloud Function
firebase deploy --only functions:createJWT
i functions: preparing functions directory for
uploading...
Error: Error parsing triggers: Failed to load gRPC binary module
because it was not installed for the current system Expected
directory: node-v79-darwin-x64-unknown Found:
[node-v64-darwin-x64-unknown] This problem can often be fixed by
running "npm rebuild" on the current system Original error: Cannot
find module
'/Users/.../cloud-functions/functions/node_modules/grpc/src/node/extension_binary/node-v79-darwin-x64-unknown/grpc_node.node'
Require stack:
- /Users/.../cloud-functions/functions/node_modules/grpc/src/grpc_extension.js
- /Users/.../cloud-functions/functions/node_modules/grpc/src/client_interceptors.js
- /Users/.../cloud-functions/functions/node_modules/grpc/src/client.js
- /Users/.../cloud-functions/functions/node_modules/grpc/index.js
- /Users/.../cloud-functions/functions/node_modules/#google-cloud/common-grpc/src/service.js
- /Users/.../cloud-functions/functions/node_modules/#google-cloud/common-grpc/src/operation.js
- /Users/.../cloud-functions/functions/node_modules/#google-cloud/common-grpc/src/index.js
- /Users/.../cloud-functions/functions/node_modules/#google-cloud/logging/src/index.js
- /Users/.../cloud-functions/functions/index.js
- /usr/local/lib/node_modules/firebase-tools/lib/triggerParser.js
Try running "npm install" in your functions directory before
deploying.
Tried npm rebuild and npm install in my functions directory and nothing works
Furthermore...could this issue be due to the fact that GCF Node runtime enviroment is Node10 and I have installed Node13 on my machine? - according to these docs:
https://cloud.google.com/functions/docs/concepts/nodejs-10-runtime
I am struggling to revert back to Node10, have tried by running brew install node#10 and get this:
Then tried running the following command as per output above to symlink it to /usr/local but still no luck
echo 'export PATH="/usr/local/opt/node#10/bin:$PATH"' >> ~/.bash_profile
Searching around about this error, indeed, this seems that the problem is related to your system waiting for a version and founding another one - as per this part of the error.
Error: Error parsing triggers: Failed to load gRPC binary module because it was not installed for the current system Expected directory: node-v79-darwin-x64-unknown Found: [node-v64-darwin-x64-unknown]
There are some options that you can give it a try, besides trying the npm rebuild. Another option might be updating the package.json - as per this case solved here - that would return your npm version to an old one.
Besides that, on this question in the Community, there are a few solutions that helped other users, that I would recommend you to take a look at it: NodeJs Error - Failed to load gRPC binary module because it was not installed for the current system Expected directory?
Let me know if the information helped you!
Trying to deploy to an unsupported Google Function execution environment won't work. According to the google docs the current supported environments are Node8 and Node10(beta), re-installing Node10 worked for me.

Node can't start app due to missing module

I have an application that I am running for the first time in a new computer. I keep getting the following error when starting the app
Error: Cannot find module './src/async'
I checked the application directory and I see the module there. I have tried re-installing the module and doing npm install and still no luck.

Resources