create-react-app does not work - node.js

i am trying to start with a react project and i installed create-react-app with npm.
When i do the command create-react-app pseudogram i get the following error:
Aborting installation.
Unexpected error. Please report it as a bug:
{ Error: Cannot find module 'C:\Users\leonel\Desktop\pseudogram\node_modules\react-scripts\package.json'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at checkNodeVersion (C:\Users\leonel\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:476:23)
at getPackageName.then.then.then.packageName (C:\Users\leonel\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:283:7)
at process._tickCallback (internal/process/next_tick.js:109:7) code: 'MODULE_NOT_FOUND' }
I tried with different versions of node and npm and still does not work.
Thanks in advance

$ npm i -g create-react-app . Install it globally.
After that, in your terminal, type $ create-react-app name-of-the-app , then $ cd name-of-the-app and finally $ npm start.
The documentation will print automatically after it finishes installing.

Related

Getting this error messages when using npx create-react-app

error messages when running npx create-react-app
When trying to create a new react app using create-react-app generator I seem to run into a this downloading error. Not sure how to fix it. I've use npx create-react-app many time before but recently it has stopped working. Any suggestions?
Andrewcarey#Andrews-MacBook-Air Strangers_Things % npx create-react-app my-app
internal/modules/cjs/loader.js:311
throw err;
^
Error: Cannot find module '/Users/andrewcarey/.npm/_npx/c67e74de0542c87c/node_modules/brace-expansion/index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (internal/modules/cjs/loader.js:303:19)
at Function.Module._findPath (internal/modules/cjs/loader.js:516:18)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/Users/andrewcarey/.npm/_npx/c67e74de0542c87c/node_modules/minimatch/minimatch.js:10:14)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32) {
code: 'MODULE_NOT_FOUND',
path: '/Users/andrewcarey/.npm/_npx/c67e74de0542c87c/node_modules/brace-expansion/package.json',
requestPath: 'brace-expansion'
}
npm ERR! code 1
npm ERR! path /Users/andrewcarey/Desktop/Strangers_Things
npm ERR! command failed
npm ERR! command sh -c create-react-app "my-app"
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/andrewcarey/.npm/_logs/2021-06-01T00_36_33_693Z-debug.log
what I normally do is let say I want my project to be called "my-app" I create a folder "my-app" open it in my terminal and then type npx create-react-app ./ I'm not sure if this is the best solution but maybe give it a try and see if it works
type in the powershell npm install -g create-react-app then type create-react-app todos-listenter image description here

after webpack i got error Cannot find module 'resolve-cwd'?

**I got error while webpack**
error is :
webpack
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'resolve-cwd'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/usr/share/nodejs/webpack/node_modules/import-local/index.js:3:20)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
please help me to resolved this problem.
I tried this one
npm install resolve-cwd .
still i am getting same issues after type webpack.i also delete node_module folder and package_json_lock file and npm install .after this run webpack still got same above error .
node --version
v10.19.0
npm --version
7.10.0
I'm not entirely sure why this happened. But I can speculate that it is due to old webpack version.
I've faced this issue right now.
I had installed webpack using apt (on Ubuntu 20.04.2 (Focal Fossa)).
Reinstalling webpack using npm resolved the issue.
Steps I followed:
$ rm $(which webpack); # removes the currently installed webpack
# you can replace $(which webpack) with the webpack location
$ npm i -g webpack webpack-cli
Despite installing the missing module 'resolve-cwd' it kept failing with another missing module.
I had to delete the node_modules folder then re-running the npm install command to install dependencies. This worked for me
I had the same issue with Resolve-CwD. But in my case it was caused by yarn not installing webpack properly.
You have an older version of node so try updating it and see if the above steps are working.
If it's not working then i'd say you try an older version of Ruby until the current issue with har-validator is sorted
In my case the error was caused because yarn was using har-validatior which is deprecated and just couldn't install webpack completely
In my case, showed me this too
So I just installed the cwd module with: npm install resolve-cwd.
And it fixed my problem.
If you are using ubuntu just add sudo before the 'webpack' command. In my case, this omission caused an error with 'resolve-cwd'

Error: Cannot find module 'commander'

when I m running sails -v, sails lift or even installing npm I m getting this error Please help -
Error: Cannot find module 'commander'
at Function.Module._resolveFilename (module.js:536:15)
at Function.Module._load (module.js:466:25)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/local/lib/node_modules/sails/bin/_commander.js:6:15)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
Most likely commander is missing from package.json. Install it and add it to package.json by doing:
npm install commander --save
Install commander globally.
sudo npm install commander -g
This will install commander module under/usr/lib/node_modules/.
Uninstalling sails and reinstalling with 'sudo' resolved it.
npm uninstall sails -g
sudo npm install sails -g
When i try setup new app with the help of express-generator.
given error:Cannot find module 'commander'
Node version:12.16.1
switch node version :10.16.3
after switch node version is working fine..
In my case it was because of bad version of node. I've tried node 8.15.1 and it works.
On my end, after doing npm install, and attempt to run npm run watch I encountered this same issue of Error: Cannot find module 'commander'.
I did below:
// delete node_modules (can do manually) or command below
// rm -rf node_modules
npm install
And I was able to do npm run watch again.
This maybe because of corrupted packages.

Unable to run basic ionic template : Error: Cannot find module 'fast-deep-equal'

I'm new to ionic and I install the basic blank template as below.
First installed ionic and Cordova using the command
npm install -g ionic Cordova.
once done created my own first ionic using command
ionic start myApp1 blank
next cd into the myApp1 directory and tried to run the application using the command .
ionic serve
but I get below error
ionic serve
Error: Cannot find module 'fast-deep-equal'
at Function.Module._resolveFilename (module.js:513:15)
at Function.Module._load (module.js:463:25)
at Module.require (module.js:556:17)
at require (internal/module.js:11:18)
at Object.<anonymous>
(D:\Proj\myApp1\node_modules\ajv\lib\compile\resolve.js:4:13)
at Module._compile (module.js:612:30)
at Object.Module._extensions..js (module.js:623:10)
at Module.load (module.js:531:32)
at tryModuleLoad (module.js:494:12)
at Function.Module._load (module.js:486:3)
I tried to remove the node_modules folder, delete the package-lock.json and install again using the command npm install but still same issue.
Ionic version is 3.19.1 and node version is 5.4.2
Please help me to resolve issue.
This error says that your project cant find module 'fast-deep-equal' so you have to install it:
cd into your project and just do:
npm install fast-deep-equal
if that gives you error, you can delete all content inside node_modules.bin\ and repeat that command.
Hope that helps you to fix that issue, it helped me.

npm install -g cordova, npm install -g ionic on Windows10

I was trying to do push notifications using angular and ionic, i was getting few issues while i was running Command prompt.
So i had to uninstall node.js and i tried to re-install the node.js , it installed successfully as i verified by node -v then it showed me v4.4.2
Then i tried to install cordova, ionic by using following commands:
npm install -g cordova
npm install -g ionic
it throwed following errors:
module.js:327
throw err;
^
Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:968:3
module.js:327
throw err;
^
Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:968:3
Can someone help me how to resolve this issue, as i tried multiple times and restarted my pc.cordova issue
Please check the attached image for the reference and let me know what changes / how to resolve this issue

Resources