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
Related
Getting the following error when I run npm start in my newly created react app that I created using npx create-react-app my-app. I tried uninstalling create react app globally and then updating my node.js version to the latest available but still getting this error. Any advice on how to fix this?
I'm on mac os
Thanks
internal/modules/cjs/loader.js:614
throw e;
^
Error: No valid exports main found for '/Users/quinnbarnett/Desktop/ugh/ugh/node_modules/postcss-safe-parser/node_modules/postcss'
at resolveExportsTarget (internal/modules/cjs/loader.js:611:9)
at applyExports (internal/modules/cjs/loader.js:492:14)
at resolveExports (internal/modules/cjs/loader.js:541:12)
at Function.Module._findPath (internal/modules/cjs/loader.js:643:22)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:941:27)
at Function.Module._load (internal/modules/cjs/loader.js:847:27)
at Module.require (internal/modules/cjs/loader.js:1016:19)
at require (internal/modules/cjs/helpers.js:69:18)
at Object.<anonymous> (/Users/quinnbarnett/Desktop/ugh/ugh/node_modules/postcss-safe-parser/lib/safe-parse.js:1:17)
at Module._compile (internal/modules/cjs/loader.js:1121:30) {
code: 'MODULE_NOT_FOUND'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ugh#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ugh#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above. ```
Try update to min v14.5 for your node.
Try installing autoprefixer#9.8.0 with npm i autoprefixer#9.8.0
It looks like a bug in node.js and there's an issue open for it.
https://github.com/facebook/create-react-app/issues/9273
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.
I am trying out AngularJS for the first time. I thought of using the angular-seed repository as a base template for starting my own AngularJS app after completing some of the courses on CodeSchool. After cloning the angular-seed repository to my computer I ran the following command within the angular-seed directory:
npm install
However, I get an error and I am unable to run the application using:
npm start
I followed the instructions as in the README file. However, the following ouput is shown in the terminal:
evert#evert-Latitude-E6530:~/AngularJS/workspace/angular-seed$ npm install
npm WARN deprecated graceful-fs#3.0.8: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
> bufferutil#1.2.1 install /home/evert/AngularJS/workspace/angular-seed/node_modules/bufferutil
> node-gyp rebuild
make: Entering directory `/home/evert/AngularJS/workspace/angular-seed/node_modules/bufferutil/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/obj.target/bufferutil.node
COPY Release/bufferutil.node
make: Leaving directory `/home/evert/AngularJS/workspace/angular-seed/node_modules/bufferutil/build'
> utf-8-validate#1.2.1 install /home/evert/AngularJS/workspace/angular-seed/node_modules/utf-8-validate
> node-gyp rebuild
make: Entering directory `/home/evert/AngularJS/workspace/angular-seed/node_modules/utf-8-validate/build'
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/obj.target/validation.node
COPY Release/validation.node
make: Leaving directory `/home/evert/AngularJS/workspace/angular-seed/node_modules/utf-8-validate/build'
> ws#0.4.32 install /home/evert/AngularJS/workspace/angular-seed/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/home/evert/AngularJS/workspace/angular-seed/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
make: Leaving directory `/home/evert/AngularJS/workspace/angular-seed/node_modules/ws/build'
> angular-seed#0.0.0 postinstall /home/evert/AngularJS/workspace/angular-seed
> bower install
/home/evert/AngularJS/workspace/angular-seed/node_modules/bower/lib/node_modules/configstore/index.js:54
throw err;
^
Error: EACCES: permission denied, open '/home/evert/.config/configstore/bower-github.json'
You don't have access to this file.
at Error (native)
at Object.fs.openSync (fs.js:634:18)
at Object.fs.readFileSync (fs.js:502:33)
at Object.create.all.get (/home/evert/AngularJS/workspace/angular-seed/node_modules/bower/lib/node_modules/configstore/index.js:35:26)
at Object.Configstore (/home/evert/AngularJS/workspace/angular-seed/node_modules/bower/lib/node_modules/configstore/index.js:28:44)
at readCachedConfig (/home/evert/AngularJS/workspace/angular-seed/node_modules/bower/lib/config.js:19:23)
at defaultConfig (/home/evert/AngularJS/workspace/angular-seed/node_modules/bower/lib/config.js:11:12)
at Object.<anonymous> (/home/evert/AngularJS/workspace/angular-seed/node_modules/bower/lib/index.js:16:32)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.0.12
npm ERR! Linux 3.13.0-85-generic
npm ERR! argv "/home/evert/local/bin/node" "/home/evert/local/bin/npm" "install"
npm ERR! node v6.1.0
npm ERR! npm v3.8.9
npm ERR! code ELIFECYCLE
npm ERR! angular-seed#0.0.0 postinstall: `bower install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-seed#0.0.0 postinstall script 'bower install'.
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 angular-seed package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! bower install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular-seed
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular-seed
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/evert/AngularJS/workspace/angular-seed/npm-debug.log
evert#evert-Latitude-E6530:~/AngularJS/workspace/angular-seed$
I have the node v6.1.0 installed with npm v3.8.9. I am running Ubuntu 14.04 LTS.
I followed some of the troubleshooting tips for npm, but still had no success.
Any other help/suggestions to get this fixed and working?
Please try this command:
sudo npm -g install bower
This will install bower as global npm package under sudo privileges.
I am trying to learn react and following egghead's video tut from https://egghead.io/lessons/react-react-fundamentals-development-environment-setup?series=react-fundamentals on setting up my dev environment. However, after installing relevant modules as mentioned in the first video, when I try npm start, it is throwing following error:
Shaileshs-MacBook-Pro:react-project shailesh$ npm start
> shaileshgupta#1.0.0 start /Users/shaileshgupta/react-project
> webpack-dev-server
/Users/shaileshgupta/react-project/webpack.config.js:3
output: {
^^^^^^
SyntaxError: Unexpected identifier
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:405:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at module.exports (/Users/shaileshgupta/react-project/node_modules/webpack/bin/convert-argv.js:80:13)
at Object.<anonymous> (/Users/shaileshgupta/react-project/node_modules/webpack-dev-server/bin/webpack-dev-server.js:55:48)
at Module._compile (module.js:398:26)
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/Cellar/node/5.3.0/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v5.3.0
npm ERR! npm v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! shaileshgupta#1.0.0 start: `webpack-dev-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the shaileshgupta#1.0.0 start script 'webpack-dev-server'.
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 shaileshgupta package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack-dev-server
npm ERR! You can get their info via:
npm ERR! npm owner ls shaileshgupta
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/shaileshgupta/react-project/npm-debug.log
I banged my head and tried to debug it, but couldn't find any possible solution to it. Could anyone help me understand what is going on here? Let me know if you need more information.
You might need to install the webpack dev server
npm install webpack-dev-server --save-dev
Post the whole code, you're probably missing a comma after the first property of module.exports object
If you have a file with the .jsx extension, try changing it to .js. That worked for me when I had the same problem.
Most of the times we will copy paste the webpack.config.js file from tutorials. Some part of the code will look like this in the webpack.config.js.
devServer: {
inline: true,
port: 8080 }
When you run npm start from command prompt you might have not installed webpack-dev-server. if so run the below line
npm install webpack-dev-server -g
In few cases webpack-dev-server is installed but something else will be running in 8080 port. In that cases simply change the port number in webpack.config.js file. below is the updated code.
devServer: {
inline: true,
port: 4000 }
That should resolve your problem.
Click here for more about this issue