!!!!!!! NOTE : The typescript is now outdated so now everyone should use "import chalk from 'chalk' " instead of "const chalk=require('chalk') " and everyone should change the extension of the file to ".mjs" from ".js" ;
@@smitpatel3981 now node forces us to use ECMAjavascript module (before it was CommonJS module) so everything is treated in import and export from instead of require and module.export to increase the code reusability. so we use ".mjs" extension and ' import chalk from "chalk" '
Sir abhi mene jab required use Kiya npm Mai to mere code me error aa rha tha is error me me do ghnte tak uljha Raha kyuki ab ES6mai import use ho rha h kisi bhi npm packege ko use krne ke liye our iske sath hi hame .json Mai bhi type module dena pad rha hai tab jakr me chalk and validator npm packege use kar paya hu 😢😢 to muje ek doubt ho rha h ki apke is course Mai node 3 years purana ho gya h to ky ab node Mai kafi new features aa gye h jo ki is series Mai Mai unhe miss kr skta hu ya fir error Mai uljha rhu our fir AI in sb ki help se mai yeh error solv krta rhunga. Ya fir Pki MERN series follow kru pr abhi mera react pr itna control nhi h 😅 react pda tha but uspe kam kiye kuch time ho gya h isliye rivision Krna pdega and sath hi project bnane pdenge react bhi mai waps se starting krunga bs 5. ,6 days bad apke hi channel se kyuki 😅 new series jo ap lekr aa gye ho
content and package.json some this is changed new contant is- import chalk from "chalk"; package.json - "type": "module", add on the top in package.json code
Hi I m raghav ,good evening thapa sir .main aapki ye playlist follow kr raha hu aur ye Jo npm wali vedio m mujhe ek problem aari h starting m hi .aur jaise hi m chalk ko install krta hu aur terminal p run krata hu to wo error de Raha h (ERR_REQUIRE_ESM )PLZ ANYONE HELP ME taki m aage ka bhi padh sku
if anyone watching the video today in 2024. if you might get an error as per below: const chalk = require("chalk") ^ ReferenceError: require is not defined in ES module scope, you can use import instead Solution - Use import import chalk from 'chalk'; and in package json add this "type": "module", post that run it .
Mere isme Chalk module install to ho gya h... lekin jab apply kar rahe h to execute me error aa raha h.. Mere pass kya error h uska photo h.. kis par send karna h bata dena.. Please solve my problem as soon as possible...
Dear Respective sir, I hope you are doing very well, I have a query chalk module after the import module when I try to run the hello world program there is a find an error (Instead change the require of F:\Nodejs\Nodechallenge pmMode ode_modules\chalk\source\index.js in F:\Nodejs\Nodechallenge pmMode\index.js to a dynamic import() which is available in all CommonJS modules.) so I need your help, sir, please help us. I request that sir please solve my problem as soon as possible.
If you are getting esm error then: Got to your package .json and add "type":"module" above debug option. And use import chalk from 'chalk' instead of the require line.
Solution: Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\Hitsof Arif\Desktop\arif ode_modules\chalk\source\index.js from C:\Users\Hitsof Arif\Desktop\arif\index.js not supported. Instead change the require of C:\Users\Hitsof Arif\Desktop\arif ode_modules\chalk\source\index.js in C:\Users\Hitsof Arif\Desktop\arif\index.js to a dynamic import() which is available in all CommonJS modules. code: 'ERR_REQUIRE_ESM' Ans: npm uninstall chalk then npm i chalk@4.1.2
Bro since last few I m jzt trying to install this npm file but it is not working after entering "npm init" all other function are working that command prompt and version stuff bt this is nt working what should I do please tell me
Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\Satish G odejsplaylistfolder\NPMmod ode_modules\chalk\source\index.js from C:\Users\Satish G odejsplaylistfolder\NPMmod\index.js not supported. Instead change the require of C:\Users\Satish G odejsplaylistfolder\NPMmod ode_modules\chalk\source\index.js in C:\Users\Satish G odejsplaylistfolder\NPMmod\index.js to a dynamic import() which is available in all CommonJS modules. at Object. (C:\Users\Satish G odejsplaylistfolder\NPMmod\index.js:2:15) { code: 'ERR_REQUIRE_ESM' }
This is because the parent folder does not contain node modules. To resolve this error please install the node module in the same folder where your JS file exists. install node modules at this location : C:\Users\Satish G odejsplaylistfolder\NPMmod
I followed your complete instruction but while importing it is showing an error to import it dynamically . So, I tried to import it using import chalk from 'chalk' Then again it is showing an error of 'Cannot use import statement outside a module'. Please help me to resolve this issue
That is something to do with the version you are using which is I think 5.0.0 npm uninstall chalk then npm i chalk@2.4.1 now you can run your code const chalk = require('chalk'); console.log(chalk.blue('Hello world!'));
IF SOMEONE IS GETTING ERROR IN HELLO WORLD CODE U CAN DO THIS :-- ADD "type": "module", just above the debug option and in index.js instead of ' require ' use :- import chalk from 'chalk' ;
at packageResolve (node:internal/modules/esm/resolve:860:9) at moduleResolve (node:internal/modules/esm/resolve:909:20) at defaultResolve (node:internal/modules/esm/resolve:1124:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:841:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:76:40) at link (node:internal/modules/esm/module_job:75:36) { code: 'ERR_MODULE_NOT_FOUND' } i stuck in case of validators anyone can help plzz
That is something to do with the version you are using which is I think 5.0.0 npm uninstall chalk then npm i chalk@2.4.1 now you can run your code const chalk = require('chalk'); console.log(chalk.blue('Hello world!'));
sir , i have problem in requiring the chalk module . It gives me error message. " Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/apple/Desktop/Javascript/node/npm module/node_modules/chalk/source/index.js from /Users/apple/Desktop/Javascript/node/npm module/index.js not supported. Instead change the require of /Users/apple/Desktop/Javascript/node/npm module/node_modules/chalk/source/index.js in /Users/apple/Desktop/Javascript/node/npm module/index.js to a dynamic import() which is available in all CommonJS modules. at Object. (/Users/apple/Desktop/Javascript/node/npm module/index.js:1:15) { code: 'ERR_REQUIRE_ESM' } " sir please solve my problem as soon as possible . Thank You
can anyone help me with this error const chalk = require("chalk"); ^ Error [ERR_REQUIRE_ESM]: require() of ES Module F: odejs pmMod ode_modules\chalk\source\index.js from F: odejs pmMod\index.js not supported. Instead change the require of F: odejs pmMod ode_modules\chalk\source\index.js in F: odejs pmMod\index.js to a dynamic import() which is available in all CommonJS modules. at Object. (F: odejs pmMod\index.js:2:15) { code: 'ERR_REQUIRE_ESM'
It's very important n awesome video 🎉 hope you like it ❤️ plz share with your friends on whatsApp group ok🙏
Mongodb bhi start kro iske bad sir
Kya is channel par koi WhatsApp group h
If it's there pls let me know...
sir, mongoDB with php in one video plz sir 🙏🙏🙏🙏
Sir i request u ...
Freelanceing k uper video bnao
!!!!!!! NOTE : The typescript is now outdated so now everyone should use "import chalk from 'chalk' " instead of "const chalk=require('chalk') " and everyone should change the extension of the file to ".mjs" from ".js" ;
why we you use .mjs instead of js any reason or why require is not work ??
please reply
thanks
@@smitpatel3981 now node forces us to use ECMAjavascript module (before it was CommonJS module) so everything is treated in import and export from instead of require and module.export to increase the code reusability. so we use ".mjs" extension and ' import chalk from "chalk" '
@Musical drug thanks 😊
Sabse badhiya tutor hain aap, aaj tak jitne bhi course videos dekhe hain youtube pe usme itna acha kisine bhi nahi sikaya
Brother, I want to meet you at least once in my life .💖💖💖💖💖💖💖💖💖💖
Awesome bro!!
Boom ho gayi like!! 😂😜
thank you so much sir u r the great reason ke within three months main frontend developer ki job kr paaya and now m moving to backend
Thank you for going so deep into how it works and importance of each file. Great explanation
We + Node = Vinod
Great class group
'CHALK' use kar k sach me chaukh gayi sir🤣. Thank you sir best tutorial in YT.
Your "Boom Guyz" is amazing
I watch your video 12 hours a day😍😍😍😍😍😍
Practice bhi karo
Awesome sir🤩❤ Congratulations for 200k subscribers
Hassan watching from Islamabad. Bohot acha kaam karrahe ho @ Vinod Bahadur Thapa
ami diner 12 ghonta watch your video. 😍
The best part I liked , complte form validation module.. thank you
Maja aa gya bro.....🥳🥳🥳
Yes..liked alot. Thank you Thapa Sir. 👌👌🙌🙌
Brother, I am a big fan of yours, I am a Bangladeshi. And I am your subscriber. I am learning watching your video on MARN Stack Development
Hi bro.. I am from Bangladesh also.. Can we talk?
yes... why not
That school wala example was funny 😜🤣
this was the best video in this playlist!
thanks yar in hindi we are getting everything that's awesome
*_NODE JS WITH MONGO DB & MYSQL TUTORIALS_*
*_HOW TO DEBUG IN VISUAL STUDIO CODE_* ❓
yess bro mujhe video axha (09:33 )laga...
You well explained all tutorials
Sir abhi mene jab required use Kiya npm Mai to mere code me error aa rha tha is error me me do ghnte tak uljha Raha kyuki ab ES6mai import use ho rha h kisi bhi npm packege ko use krne ke liye our iske sath hi hame .json Mai bhi type module dena pad rha hai tab jakr me chalk and validator npm packege use kar paya hu 😢😢 to muje ek doubt ho rha h ki apke is course Mai node 3 years purana ho gya h to ky ab node Mai kafi new features aa gye h jo ki is series Mai Mai unhe miss kr skta hu ya fir error Mai uljha rhu our fir AI in sb ki help se mai yeh error solv krta rhunga. Ya fir Pki MERN series follow kru pr abhi mera react pr itna control nhi h 😅 react pda tha but uspe kam kiye kuch time ho gya h isliye rivision Krna pdega and sath hi project bnane pdenge react bhi mai waps se starting krunga bs 5. ,6 days bad apke hi channel se kyuki 😅 new series jo ap lekr aa gye ho
content and package.json some this is changed
new contant is- import chalk from "chalk";
package.json - "type": "module", add on the top in package.json code
thanks bro this solution work
thank u so much..i completely understood npm
thank bro i am learning thnigs slowly and clearly
same bro
@@Ayush-lj6pq lekin bro yaar bhot se doubts aa re h
Awesome videos. Vinod Thapa
Your teaching is awesome
please help chalk 5.0.0 version not supported or executed using require function.
if u guyzz are facing problem ,you can use this command for installing chalk
npm i chalk@4.1.1
instead of npm i chalk
thanks
Thanks
hello better teacher than my clg teachers
Right bro
Same
NIce tutorial bro
Watched from Bangladesh
your all videos is very helpful for me thanx sir
So nice of you
Best dialog 'hit kijiye click kijiye'
If you are getting ESM error...
1⃣ : npm uninstall chalk
2⃣: npm i chalk@2.4.1
than run ur code...
it's really version problem of 5.0.0 something...
thank you
Hi I m raghav ,good evening thapa sir .main aapki ye playlist follow kr raha hu aur ye Jo npm wali vedio m mujhe ek problem aari h starting m hi .aur jaise hi m chalk ko install krta hu aur terminal p run krata hu to wo error de Raha h (ERR_REQUIRE_ESM )PLZ ANYONE HELP ME taki m aage ka bhi padh sku
Require example of school is very nice ,examples are awesome bro 💞💞 finally awesome vedio🌹
I practice it bro awesome 💞
i am your big fan bhaiya
Why in my case it shows es module require.....it says you have to write
Import chalk from 'chalk'
Yes it works
vai love from bangladesh.
Sir ismei ek error aa rha hai require() of es modules is not supported. Yeh kya hai??
Great tutorial @vinod.
if anyone watching the video today in 2024. if you might get an error as per below:
const chalk = require("chalk")
^
ReferenceError: require is not defined in ES module scope, you can use import instead
Solution - Use import
import chalk from 'chalk'; and in package json add this "type": "module", post that run it .
Mere isme Chalk module install to ho gya h...
lekin jab apply kar rahe h to execute me error aa raha h..
Mere pass kya error h uska photo h.. kis par send karna h bata dena..
Please solve my problem as soon as possible...
bhai extention me mjs use kr module update hua h or
const chalk = require("chalk") ki jgha import chalk from 'chalk use kr'
sir you have quality of it
Sir kitna time lagega is playlist ko ??
Nice Video
Thanks so much supported
Dear Respective sir, I hope you are doing very well, I have a query chalk module after the import module when I try to run the hello world program there is a find an error (Instead change the require of F:\Nodejs\Nodechallenge
pmMode
ode_modules\chalk\source\index.js in F:\Nodejs\Nodechallenge
pmMode\index.js to a
dynamic import() which is available in all CommonJS modules.) so I need your help, sir, please help us.
I request that sir please solve my problem as soon as possible.
If you are getting esm error then:
Got to your package .json and add "type":"module" above debug option.
And use import chalk from 'chalk' instead of the require line.
@@AnjaanCelebrity Thanku so much
@@AnjaanCelebrity Thanks bro
@@AnjaanCelebrity It didn't work for me , pls help someone , getting error module not found
@@AnjaanCelebrity thank u brother
bro, u r just awesome thanks bhai
sir ,it is throwing some error like import can't be used out side the module
This video is really Awesome
Why error comming in my project code: 'ERR_REQUIRE_ESM'
Super duper tutorial 💓😍💓☺
thanks for perfect teaching
Good Videos' with information
Amazing Tutorial!!
if you getting error in using chalk, use older version .. npm i chalk@4.1.2
Thank you so muchh
i cant express how much you have helped me.
was stuck on this since 4 hours😮💨
if Any one facing one problem that
const chalk = require('chalk')
^
so they need to change extenstion from '.js' to '.mjs'
Thankyou
Thanks brother it worked!!!!🎉🎉❤❤❤
Thanks, Amazing Tutorial!!
Solution:
Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\Hitsof Arif\Desktop\arif
ode_modules\chalk\source\index.js from C:\Users\Hitsof
Arif\Desktop\arif\index.js not supported.
Instead change the require of C:\Users\Hitsof Arif\Desktop\arif
ode_modules\chalk\source\index.js in C:\Users\Hitsof Arif\Desktop\arif\index.js to a dynamic import() which is available in all CommonJS modules.
code: 'ERR_REQUIRE_ESM'
Ans:
npm uninstall chalk
then
npm i chalk@4.1.2
thanks bro👍👍
I was frusted and finally got it.
thanks bro it worked
thanks bro , i was puzzled
Thank you so much men I am frustrated with this, it worked 🥳
Npm uninstall chalk giving more error
amazing one....
mare systeam m Error: cannot find module 'chalk' aa raha h how to resolve it pls.. help me
Bro since last few I m jzt trying to install this npm file but it is not working after entering "npm init" all other function are working that command prompt and version stuff bt this is nt working what should I do please tell me
Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\Satish G
odejsplaylistfolder\NPMmod
ode_modules\chalk\source\index.js from C:\Users\Satish G
odejsplaylistfolder\NPMmod\index.js not supported.
Instead change the require of C:\Users\Satish G
odejsplaylistfolder\NPMmod
ode_modules\chalk\source\index.js in C:\Users\Satish G
odejsplaylistfolder\NPMmod\index.js to a dynamic import() which is available in all CommonJS modules.
at Object. (C:\Users\Satish G
odejsplaylistfolder\NPMmod\index.js:2:15) {
code: 'ERR_REQUIRE_ESM'
}
This is because the parent folder does not contain node modules.
To resolve this error please install the node module in the same folder where your JS file exists.
install node modules at this location : C:\Users\Satish G
odejsplaylistfolder\NPMmod
I followed your complete instruction but while importing it is showing an error to import it dynamically . So, I tried to import it using import chalk from 'chalk' Then again it is showing an error of 'Cannot use import statement outside a module'. Please help me to resolve this issue
Same issue if you found any answer do let mw know
@@Roman_Baloch downgrade your chalk version to 4
downgrade your chalk version to 4
same issue brother
That is something to do with the version you are using which is I think 5.0.0
npm uninstall chalk
then
npm i chalk@2.4.1
now you can run your code
const chalk = require('chalk'); console.log(chalk.blue('Hello world!'));
Thanks brother.i was stuck for 15 mins for the same..
Thanks bro 🙂
IF SOMEONE IS GETTING ERROR IN HELLO WORLD CODE U CAN DO THIS :-- ADD "type": "module", just above the debug option and in index.js instead of
' require ' use :- import chalk from 'chalk' ;
Thanks
thankss
Thanks
very informative lecture
This package.json file already in reactjs.
So for reactjs we don't need to write npm init?
Sir your teaching style is superb!!!! But the last music also superrr!!! can you provide me the music link..
SIR ITS AWESOME
Angular pe koi video series banaye to achha rahega
Bhaiya isme error aa rhi hai 'module not found' likh ke AA rha hai
U r right bro
path shi s check kro
Sir jab mai code ko run kar ra to
'ERR_REQUIRE_ESM'
ye likha ara sir maine kahi bar try kar liya ,agr aap help kar dete to bht mehrbani 🙏
Very nice Sir 👍
Hi thapa, when I installed NPM file in vs code then show some error thants why I not able toh install chalk module and validation module, pls help
npm chalk instal nahi horaha hai.
what did I do?
Sir, top 20 NPM PACKAGE FOR ECOMMERCE WEBSITE
awesome ❤❤
We are waiting for him to appear on youtube fanfest though it might take a long time
Sir great!
at packageResolve (node:internal/modules/esm/resolve:860:9)
at moduleResolve (node:internal/modules/esm/resolve:909:20)
at defaultResolve (node:internal/modules/esm/resolve:1124:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:841:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ModuleWrap. (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
i stuck in case of validators anyone can help plzz
npm chalk are not install in program, please give me suggestion
Thanks bro🎉
Sir, when I write 'node index.js' in terminal then terminal throw error
But when I write './node index.js' then it's correct plz solve my problem
node ./index.js is correct
That is something to do with the version you are using which is I think 5.0.0
npm uninstall chalk
then
npm i chalk@2.4.1
now you can run your code
const chalk = require('chalk'); console.log(chalk.blue('Hello world!'));
Awesome video
Sir plz tell me the intro song name plz, I have a humble request to you sir plz plz 🙏
Chalk not working 2022 why? Please help
sir , i have problem in requiring the chalk module . It gives me error message. " Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/apple/Desktop/Javascript/node/npm module/node_modules/chalk/source/index.js from /Users/apple/Desktop/Javascript/node/npm module/index.js not supported.
Instead change the require of /Users/apple/Desktop/Javascript/node/npm module/node_modules/chalk/source/index.js in /Users/apple/Desktop/Javascript/node/npm module/index.js to a dynamic import() which is available in all CommonJS modules.
at Object. (/Users/apple/Desktop/Javascript/node/npm module/index.js:1:15) {
code: 'ERR_REQUIRE_ESM'
} "
sir please solve my problem as soon as possible .
Thank You
install npm install chalk@4.1.0 and then run the code. You won't get any error.
can anyone help me with this error
const chalk = require("chalk");
^
Error [ERR_REQUIRE_ESM]: require() of ES Module F:
odejs
pmMod
ode_modules\chalk\source\index.js from F:
odejs
pmMod\index.js not supported.
Instead change the require of F:
odejs
pmMod
ode_modules\chalk\source\index.js in F:
odejs
pmMod\index.js to a dynamic import() which is available in all CommonJS modules.
at Object. (F:
odejs
pmMod\index.js:2:15) {
code: 'ERR_REQUIRE_ESM'
Thanks sir for this video
bro you are love
you are awesome awesome
asesome vidio but may be this code will be have little trouble on working with the version 5.0.0
of chalk
great video
"ERR_REQUIRE_ESM"
A rha h sir jab chalk ka code console kar rhe h
install npm install chalk@4.1.0 and then run.
2:04 that 10% people🗿