when I run this command in my project:
yarn eject
shows this eror:
[root#VM-0-16-centos cruise-web]# yarn eject
yarn run v1.22.10
$ react-scripts eject
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module 'react-dev-utils/inquirer'
Require stack:
- /home/dolphin/sync/source/cruise-web/node_modules/react-scripts/scripts/eject.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Module.require (internal/modules/cjs/loader.js:903:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/dolphin/sync/source/cruise-web/node_modules/react-scripts/scripts/eject.js:23:18)
at Module._compile (internal/modules/cjs/loader.js:1015:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
at Module.load (internal/modules/cjs/loader.js:879:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/dolphin/sync/source/cruise-web/node_modules/react-scripts/scripts/eject.js'
]
}
then I add a dependency in my package.json:
"react-dev-utils":"11.0.1"
then run the command to install and rerun eject:
yarn
yarn eject
but the problem still not fixed, what should I do to make it work?
I just had the same problem. Check out react-scripts version on package.json.
I guessed that this (https://github.com/facebook/create-react-app/pull/10083) would be a reason why yarn eject throw err.
I was able to solve the problem by installing the last version of react-script:
npm install react-scripts#4.0.1
Related
As of yesterday, I suddenly started getting this error when running the 'npm start' script in my create-react-app. I never had this issue before, and have not changed any configuration or package.json files in or out of react-scripts. terser-webpack-plugin is installed at the location and its "main" is:
"main": "dist/index.js",
I have tried reinstalling node_modules with no luck. I also tried the solution here: Use latest terser-webpack-plugin with Webpack5
throw err;
^
Error: Cannot find module 'Z:\Documents\chat-test\my-app\node_modules\terser-webpack-plugin\dist\index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:353:19)
at Function.Module._findPath (node:internal/modules/cjs/loader:566:18)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
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> (Z:\Documents\chat-test\my-app\node_modules\react-scripts\config\webpack.config.js:18:22)
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) {
code: 'MODULE_NOT_FOUND',
path: 'Z:\\Documents\\chat-test\\my-app\\node_modules\\terser-webpack-plugin\\package.json',
requestPath: 'terser-webpack-plugin'
}
Possible fixes, try either or both:
npm i --save-dev terser-webpack-plugin
Remove package.lock and run npm i
I´m getting an error using yarn to create a nextJS app, i just run:
yarn create next-app --typescript
then just run:
yarn dev
usually this error is showed:
yarn dev
yarn run v1.22.17
$ next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
node:internal/modules/cjs/loader:933
const err = new Error(message);
^
Error: Cannot find module 'styled-jsx'
Require stack:
- C:\Users\Felipe\Desktop\programação-estudos\alura-challenge-front-end-1\node_modules\next\dist\server\render.js
- C:\Users\Felipe\Desktop\programação-estudos\alura-challenge-front-end-1\node_modules\next\dist\server\next-server.js
- C:\Users\Felipe\Desktop\programação-estudos\alura-challenge-front-end-1\node_modules\next\dist\server\next.js
- C:\Users\Felipe\Desktop\programação-estudos\alura-challenge-front-end-1\node_modules\next\dist\server\lib\start-server.js
- C:\Users\Felipe\Desktop\programação-estudos\alura-challenge-front-end-1\node_modules\next\dist\cli\next-dev.js
- C:\Users\Felipe\Desktop\programação-estudos\alura-challenge-front-end-1\node_modules\next\dist\bin\next
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.mod._resolveFilename (C:\Users\Felipe\Desktop\programação-estudos\alura-challenge-front-end-1\node_modules\next\dist\build\webpack\require-hook.js:183:28)
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> (C:\Users\Felipe\Desktop\programação-estudos\alura-challenge-front-end-1\node_modules\next\dist\server\render.js:11:18)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\Felipe\\Desktop\\programação-estudos\\alura-challenge-front-end-1\\node_modules\\next\\dist\\server\\render.js',
'C:\\Users\\Felipe\\Desktop\\programação-estudos\\alura-challenge-front-end-1\\node_modules\\next\\dist\\server\\next-server.js',
'C:\\Users\\Felipe\\Desktop\\programação-estudos\\alura-challenge-front-end-1\\node_modules\\next\\dist\\server\\next.js',
'C:\\Users\\Felipe\\Desktop\\programação-estudos\\alura-challenge-front-end-1\\node_modules\\next\\dist\\server\\lib\\start-server.js',
'C:\\Users\\Felipe\\Desktop\\programação-estudos\\alura-challenge-front-end-1\\node_modules\\next\\dist\\cli\\next-dev.js',
'C:\\Users\\Felipe\\Desktop\\programação-estudos\\alura-challenge-front-end-1\\node_modules\\next\\dist\\bin\\next'
]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
but even if i install the dependecies the same error apears with another dependencie, if i use npm works how it´s supose to works.
edit: my pc had a error in the ssd and some file had been corrupted, but i alredy reinstall npm and yarn but dind´t work.
I honestly dont even know what question I should be asking here, but npm run build fails
> color-organizer#1.0.0 build /home/francis/Desktop/react/chapter-
06/color-organizer
> webpack --progress
module.js:471
throw err;
^
Error: Cannot find module 'set-blocking'
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 Object.<anonymous> (/home/francis/.nvm/versions/node/v5.0.0/lib/node_modules/webpack/node_modules/yargs/lib/usage.js:5:21)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
node -v gives me
v6.11.0
so its weird that i see 5 in this error log. I do need to note that i was running on 5 before, and just recently upgraded to 6.11 in the middle of this problem
i'm on ubuntu 16.04
i'm just trying to follow these examples https://github.com/MoonHighway/learning-react/ and start a server for 6, but i can't
and its pissing me off
Running npm install fixed the error for me using the latest versions. Otherwise you may try the command npm install set-blocking or npm install set-blocking --save-dev to only install the module as a developer dependency.
I am getting the following error upon runing bower install.
$ bower install
module.js:340
throw err;
^
Error: Cannot find module 'minimist'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:289:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/home/ubuntu/.nvm/versions/node/v5.1.0/lib/node_modules/bower/node_modules/bower-config/node_modules/optimist/index.js:2:16)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
I have "minimist" installed as a local npm package but not globally. Is there any way to get bower to recognize the local package and avoid installing minimist globally?
Running npm install -S minimist in a CLI from your project root directory should solve your problem.
webpack.config.js
var ExtractTextPlugin = require("extract-text-webpack-plugin");
I immediately receive this error if I just implement the plugin:
module.js:339
throw err;
^
Error: Cannot find module 'webpack/lib/ConcatSource'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/Users/lucamormile/Documents/Lavori/Webapps/React/webpack_test/node_modules/extract-text-webpack-plugin/index.js:5:20)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
What did i forgot?
Do you have webpack module on your project?
If not, install it locally (not globally):
$ npm install webpack [--save-dev]
extract-text-webpack-plugin needs webpack as peer dependency, but npm 3 doesn't install peer dependencies automatically.
You can try this command which I found on https://www.npmjs.com/package/extract-text-webpack-plugin
npm i extract-text-webpack-plugin
I solve it by use
npm install extract-text-webpack-plugin --save-dev
Use $ npm i -D extract-text-webpack-plugin#next and this would solve your issue
Let me know if this worked.
https://github.com/webpack/webpack/issues/6568
Running npm i node-sass might solve your problem