After ejecting app with Yarn doesn’t start anymore - reactjs

I'm new to React Native and want to do some tutorials. But after I eject the project through:
yarn eject
I get this error in the terminal:
yarn run v1.13.0
$ react-native run-ios
internal/modules/cjs/loader.js:582
throw err;
^
Error: Cannot find module '#babel/runtime/helpers/interopRequireDefault'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/Users/joppemeijers/Documents/react/cashierr/node_modules/react-native/local-cli/cliEntry.js:11:41)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Module._compile (/Users/joppemeijers/Documents/react/cashierr/node_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Object.newLoader [as .js] (/Users/joppemeijers/Documents/react/cashierr/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:598:32)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
This is a whole new project and I didn't add anything. I searched on Google for some solutions but can't get it fixed, maybe some of you guys can help me?
Is there something I don’t have installed?

Related

React: create-react-app fails with error "Cannot find module 'libnpx'

OS-ubuntu
IDE-VS-Code
npx create-react-app was working fine,I wanted to work on a personal project when i run in to a suggestion that Create React App requires Node 14 or higher. I tried updating node using the following commands sudo npm cache clean -f and then sudo npm install -g n then i ran sudo n stable the following was installed installed : v16.13.1 (with npm 8.1.2).When i tried running npx create-react-app I got the following error
Error: Cannot find module 'libnpx'
Require stack:
- /usr/share/npm/bin/npx-cli.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/usr/share/npm/bin/npx-cli.js:3:13)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/usr/share/npm/bin/npx-cli.js' ]
}
What i tried after getting the error,
The solution below;
React: create-react-app fails with error "Cannot find module 'lodash'"
How do I approach resolving this problem so that I can get started with my personal project and learning the framework?
Restart your terminal after updating node version.
Restarted vs-code and it started working fine.Hope this helps someone facing the same error

Why does a fresh gatsby install return a module not found error?

Description
It all started after I updated Gatsby to the latest version in my project that I would receive an error saying the Gatsby-cli module could not be found (error written below) after running gatsby develop After a lot of troubleshooting, I tried creating a new gatsby site with a fresh install of npm install -g gatsby-cli
and npm install -g gatsby, but I was getting the same error. Even after running gatsby -v I get the same error. It doesn't seem to be installing gastby?
Error Message
C:\Users\ctsyg\AppData\Roaming\npm\node_modules\gatsby-cli\node_modules\yoga-layout-prebuilt\yoga-layout\build\Release\nbind.js:53
throw ex;
^
Error: Package exports for 'C:\Users\ctsyg\AppData\Roaming\npm\node_modules\gatsby-cli\node_modules\clipboardy' do not define a '.' subpath
at resolveExports (internal/modules/cjs/loader.js:419:17)
at Function.Module._findPath (internal/modules/cjs/loader.js:492:20)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:787:27)
at Function.Module._load (internal/modules/cjs/loader.js:693:27)
at Module.require (internal/modules/cjs/loader.js:864:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (C:\Users\ctsyg\AppData\Roaming\npm\node_modules\gatsby-cli\lib\create-cli.js:24:20)
at Module._compile (internal/modules/cjs/loader.js:971:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1011:10)
at Module.load (internal/modules/cjs/loader.js:822:32) {
code: 'MODULE_NOT_FOUND'
}
Fixed: I had to reinstall node.js for some reason.

MODULE NOT FOUND after running axios

While I was compiling the code using npm start an error occurred.
I create the Axios Instance by running npm install --save axios , but after that i run yarn start its not running.strong text
Here is the error log:
yarn run v1.22.4
$ node scripts/start.js
internal/modules/cjs/loader.js:983
throw err;
^
Error: Cannot find module 'resolve'
Require stack:
- /home/falguni/Documents/the_burger_builder/config/webpack.config.js
- /home/falguni/Documents/the_burger_builder/scripts/start.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
at Function.Module._load (internal/modules/cjs/loader.js:862:27)
at Module.require (internal/modules/cjs/loader.js:1040:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/falguni/Documents/the_burger_builder/config/webpack.config.js:6:17)
at Module._compile (internal/modules/cjs/loader.js:1151:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14)
at Module.require (internal/modules/cjs/loader.js:1040:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/falguni/Documents/the_burger_builder/config/webpack.config.js',
'/home/falguni/Documents/the_burger_builder/scripts/start.js'
]
}
error Command failed with exit code 1.
This is showing in my terminal and it is not running the server.
Capitalize your folder names and js file names.
try
yarn add axios
instead of
npm install axios
I am not clear but i think this will work

Cannot find module 'delegates' in CRA yarn add node-sass

I have created a fresh app with CRA and want to add Sass support according to its official description which simply says to add it with yarn add node-sass
but this throws an error
error /home/.../frontend/node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/install.js
Arguments:
Directory: /home/.../frontend/node_modules/node-sass
Output:
module.js:550
throw err;
^
Error: Cannot find module 'delegates'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/amir/WORKSPACE/daypay/daypay_v2/frontend/node_modules/are-we-there-yet/tracker-stream.js:4:16)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
I dont know why but it seems node_modules where messed up though it was a new created app.
SO I hard coded the node-sass and #types/node-sass in package.json deleted the yarn.lock or (package-lock) and node_modules folder and run yarn install again

Can't run gulp - Unexpected token ]

I want to create an application with angular2, and I've downloaded the angular2 folder structure from here.
I've also installed globally gulp in my system with npm install gulp –g, now when I try to run gulp with the command gulp I get this error:
undefined:14
]
^
SyntaxError: Unexpected token ]
at Object.parse (native)
at Function.createProject (/home/pc02/Desktop/myapp/angular-2-beta-boilerplate/node_modules/gulp-typescript/release/main.js:195:40)
at Object.<anonymous> (/home/pc02/Desktop/myapp/angular-2-beta-boilerplate/gulpfile.js:26:28)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Liftoff.handleArguments (/usr/local/lib/node_modules/gulp/bin/gulp.js:116:3)
I'm working on Ubuntu
If you're on Ubuntu, you should run: sudo npm install gulp -g. It won't get installed properly without the "sudo".

Resources