I am a new react student, have no place else to ask this question and can't solve it on my own because I'm really confused, I don't even know how to put this question together properly. I'm following the instructions from a react course.
I installed node.js, created a new project folder, then in the terminal I wrote create react-app . everything worked, and then wrote npm run build and npm start, but both didn't work.
Heres the error messages for npm run build:
> github-finder#0.1.0 build C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder
> react-scripts build
"Courses\github-finder\node_modules\.bin\" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module 'C:\Users\liana\Documents\My stuff\Webdev\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! github-finder#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the github-finder#0.1.0 build 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\liana\AppData\Roaming\npm-cache\_logs\2020-10-18T02_07_40_371Z-debug.log
PS C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder> npm run build
> github-finder#0.1.0 build C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder
> react-scripts build
"Courses\github-finder\node_modules\.bin\" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module 'C:\Users\liana\Documents\My stuff\Webdev\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! github-finder#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the github-finder#0.1.0 build 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\liana\AppData\Roaming\npm-cache\_logs\2020-10-18T02_10_32_763Z-debug.log
PS C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder>
And heres the code for npm start
> github-finder#0.1.0 start C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder
> react-scripts start
"Courses\github-finder\node_modules\.bin\" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module 'C:\Users\liana\Documents\My stuff\Webdev\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! github-finder#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the github-finder#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\liana\AppData\Roaming\npm-cache\_logs\2020-10-18T02_11_45_759Z-debug.log
PS C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder>
some messages are in russian, if you need translation use the translator or ask me to leave the translation here, whatever you prefer
Thank you for reading this, I'm desperate and need help, nothing on the internet helped me just yet
I found something that works.
Using the command node node node_modules/react-scripts/scripts/start.js does the same thing as npm start, though I don't know what's the catch here. Works for me. Source: https://github.com/facebook/create-react-app/issues/8221
Firstly to create your project based on "create-react...."
You have to use the exactly command "npx create-react-app 'yournameProject'"
Then open your folder in a text editor like visual code and run the following command -> "npm start"
It shouldnt give you error
About your problem: I think you have stepped something
So try to use first "npm i" then "npm start"
Related
returncode: 1
stdout:
> my-app#0.1.0 start2 /home/ikanet/ali
> set NODE_ENV=production && node app
stderr:
npm WARN lifecycle The node binary used for scripts is /home/ikanet/nodevenv/ali/14/bin/node but npm is using /opt/alt/alt-nodejs14/root/usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
internal/modules/cjs/loader.js:905
throw err;
^
Error: Cannot find module '/home/ikanet/ali/app'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app#0.1.0 start2: `set NODE_ENV=production && node app`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-app#0.1.0 start2 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! /home/ikanet/.npm/_logs/2023-01-15T12_05_18_250Z-debug.log
i build my next project and config server.js. then upload all my files without node-modules in my server
run nodejs setup , and i faced this error.
my server : nodejs version 14
When i start my react project all seems good, but when i try to build this, it doesn't work, i have this error :
node:internal/fs/utils:344
throw err;
^
Error: UNKNOWN: unknown error, lstat 'C:\Users\darkx\Bureau\mlvojobs\mlvojobs\node_modules\fs-extra\lib\util'
at Object.realpathSync (node:fs:2490:7)
at toRealPath (node:internal/modules/cjs/loader:394:13)
at tryFile (node:internal/modules/cjs/loader:390:10)
at tryExtensions (node:internal/modules/cjs/loader:402:22)
at Function.Module._findPath (node:internal/modules/cjs/loader:558:20)
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> (C:\Users\darkx\Bureau\mlvojobs\mlvojobs\node_modules\fs-extra\lib\copy\copy.js:7:22) {
errno: -4094,
syscall: 'lstat',
code: 'UNKNOWN',
path: 'C:\\Users\\darkx\\Bureau\\mlvojobs\\mlvojobs\\node_modules\\fs-extra\\lib\\util'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mlvojobs#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mlvojobs#0.1.0 build 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\darkx\AppData\Roaming\npm-cache\_logs\2022-08-18T22_53_48_493Z-debug.log
PS C:\Users\darkx\Bureau\mlvojobs\mlvojobs> npm install fs-extra
npm ERR! cb.apply is not a function
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\darkx\AppData\Roaming\npm-cache\_logs\2022-08-18T22_54_15_541Z-debug.log
And when i try to install something with npm it says :
npm ERR! cb.apply is not a function
Node.js sometimes works weird. I encountered this error, my option is switch to another Node.js version.
I recommend using nvm-windows (seem like you're using Windows)
You can install latest Node.js version lts
nvm install lts
Or specific version, for example:
nvm install 16.16.0
Then delete your project node_modules and run:
npm install
Finally, build your project again. Let me know if it work!
Possible solution :
Go to : C:\Users(your username)\AppData\Roaming
Delete the npm folder and if there is one npm cache folder.
Run npm cache clean —force
it should work
It happens when I try to start server. This is probably not a problem with npm. There is likely additional logging output above.
I got everything updated and still same.
internal/modules/cjs/loader.js:983
throw err;
^
Error: Cannot find module '/Users/Mateusz/Documents/reactWebsite/node_modules/webpack-dev-server/bin/webpack-dev-server.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
at Function.Module._load (internal/modules/cjs/loader.js:862:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! redux-simple-starter#1.0.0 start: `node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the redux-simple-starter#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! /Users/Mateusz/.npm/_logs/2020-02-20T09_12_14_220Z-debug.log`enter code here`
I don't know the why this error occurs, but I once got this error and solved through the following steps:
Delete node_modules and package-lock.json
Run npm install
Start the server again
I habe an azur app service (Linux), connected to a bitbucket git repository running.
When I try to deploy it, I get this error:
> lhfrontend#1.0.0 postinstall /home/site/wwwroot
> npm run webdriver:update
npm WARN invalid config loglevel="notice"
> lhfrontend#1.0.0 webdriver:update /home/site/wwwroot
> node ./node_modules/protractor/bin/webdriver-manager update
module.js:471
throw err;
^
Error: Cannot find module '/home/site/wwwroot/node_modules/protractor/bin/webdriver-manager'
An error has occurred during web site deployment.
at Function.Module._resolveFilename (module.js:469:15)
npm failed
at Function.Module._load (module.js:417:25)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:389:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:504:3
npm ERR! Linux 4.4.0-108-generic
npm ERR! argv "/opt/nodejs/6.11.0/bin/node" "/usr/bin/node_modules/npm/bin/npm-cli.js" "run" "webdriver:update"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! lhfrontend#1.0.0 webdriver:update: `node ./node_modules/protractor/bin/webdriver-manager update`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lhfrontend#1.0.0 webdriver:update script 'node ./node_modules/protractor/bin/webdriver-manager update'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the lhfrontend package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./node_modules/protractor/bin/webdriver-manager update
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs lhfrontend
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls lhfrontend
npm ERR! There is likely additional logging output above.
Does any one have an idea, how to fix this?
Thanks in advance,
Dennis
Check if you have installed protractor module. If not, run this command in your app's root:
npm install protractor
Or add this to the dependencies section of your package.json:
"dependencies": {
"protractor": "^5.2.2"
}
I typically just run npm start for my create-react-app project but after I restarted my computer I can no longer do it and get this weird error:
module.js:341
throw err;
^
Error: Cannot find module './Template'
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object.<anonymous> (/Users/richardbustos/Google Drive/workspace/portfolio/node_modules/webpack/lib/MainTemplate.js:8:16)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v5.5.0
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! portfolio#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the portfolio#0.1.0 start script 'react-scripts start'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the portfolio package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! react-scripts start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs portfolio
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls portfolio
npm ERR! There is likely additional logging output above.
I tried running npm install and updating npm and npde but nothing worked
Ahh found a fix. All i had to do was:
rm -rf node_module
to clean then ran
npm install
That seemed to work =)
I had the same issue running the npm start command.
Installing the npm version 4.6.1 helped me solve the problem. I hope it is helpful for some of you.