config is not defined

พูดคุยแลกเปลี่ยน ปัญหา การเขียน JavaScript เครื่องมือ AJAX Web 2.0 AJAX Framework jQuery และ Node.JS รวมถึง Framework Express ของ Node.JS ทำงานฝั่ง Server

Moderator: mindphp

Nes224
PHP Super Member
PHP Super Member
โพสต์: 441
ลงทะเบียนเมื่อ: 20/12/2021 11:36 am

config is not defined

โพสต์ที่ยังไม่ได้อ่าน โดย Nes224 »

ตรงนี้ต้อง config ยังไงบ้างครับ


Error Alert

โค้ด: เลือกทั้งหมด


C:\Users\ACER\Desktop\NodeJs\iiec_xxxx>npm start

> [email protected] start C:\Users\ACER\Desktop\NodeJs\iiec_u4e2
> node bin/www

C:\Users\ACER\Desktop\NodeJs\iiec_u4e2\app\lib\common.js:157
        config = Object.assign(config, localConfigFile);    
                               ^

ReferenceError: config is not defined
    at Object.getConfig (C:\Users\ACER\Desktop\NodeJs\iiex_xxxx\app\lib\common.js:157:32)
    at Object.<anonymous> (C:\Users\ACER\Desktop\NodeJs\iiex_xxxx\app.js:35:23)
    at Module._compile (internal/modules/cjs/loader.js:774:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Module.require (internal/modules/cjs/loader.js:681:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (C:\Users\ACER\Desktop\NodeJs\iiex_xxxx\bin\www:7:11)
    at Module._compile (internal/modules/cjs/loader.js:774:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node bin/www`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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\ACER\AppData\Roaming\npm-cache\_logs\2021-12-24T09_15_51_787Z-debug.log

C:\Users\ACER\Desktop\NodeJs\iiec_u4e2>
แก้ไขล่าสุดโดย Nes224 เมื่อ 27/12/2021 9:00 pm, แก้ไขไปแล้ว 3 ครั้ง.
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41238
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: config is not defined

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

กำหนด path ผิด เลยไม่รู้จัก config
ได้ลองทำตามนี้หรือยังครับ
viewtopic.php?f=18&t=80345&p=235022#p235022
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41238
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: config is not defined

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

สอบถามเจ้าของกระทู้ กับคำตอบที่แนะนำไป เป็นอย่างไรบ้างครับ
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
Nes224
PHP Super Member
PHP Super Member
โพสต์: 441
ลงทะเบียนเมื่อ: 20/12/2021 11:36 am

Re: config is not defined

โพสต์ที่ยังไม่ได้อ่าน โดย Nes224 »

ได้ลองทำตามคำแนะนำแล้วครับ ยังไม่สามารถ run ได้ครับ
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41238
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: config is not defined

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

Nes224 เขียน: 26/12/2021 4:50 pm ได้ลองทำตามคำแนะนำแล้วครับ ยังไม่สามารถ run ได้ครับ
รันไม่ได้ ขึ้นข้อความอะไร ลงรายละเอียดมาหน่อยครับ
และ ทำอะไรไปบ้างแล้ว
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
Nes224
PHP Super Member
PHP Super Member
โพสต์: 441
ลงทะเบียนเมื่อ: 20/12/2021 11:36 am

Re: config is not defined

โพสต์ที่ยังไม่ได้อ่าน โดย Nes224 »

ได้ลองทำตามกระทู้นี้แล้วครับ >>viewtopic.php?f=18&t=80345

check version node
check version npm

path ที่ใช้ในการ run
และผลลัพธิ์ได้แจ้งไปในกระทู้ครับ

ติดปัญหาคือ การหา path folder ของ module ครับ
ได้ลองทำการค้นดูปัญหาดังกล่าว
ตามลิ้งนี้ครับ >> https://askubuntu.com/questions/1189230 ... de-modules

มี error alert บอกว่า

npm ERR! peer dep missing: bufferutil@^4.0.1, required by [email protected]
npm ERR! peer dep missing: utf-8-validate@^5.0.2, required by [email protected]
npm ERR! peer dep missing: ajv@^6.9.1, required by [email protected]
npm ERR! peer dep missing: ajv@^6.9.1, required by [email protected]

ของตัว national ครับ และตัว api.u4e ครับข้างล่าง

npm ERR! peer dep missing: bufferutil@^4.0.1, required by [email protected]
npm ERR! peer dep missing: utf-8-validate@^5.0.2, required by [email protected]
npm ERR! peer dep missing: ajv@^6.9.1, required by [email protected]
npm ERR! peer dep missing: ajv@^6.9.1, required by [email protected]
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41238
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: config is not defined

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

ตามตัวอย่างเครื่องเป็น windows แต่ลิงค์ที่เอามาอ้าง เป็นของ ubuntu นะครับ

และไม่ควร set ระบบ git ไว้บน Desktop นะครับ
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
Nes224
PHP Super Member
PHP Super Member
โพสต์: 441
ลงทะเบียนเมื่อ: 20/12/2021 11:36 am

Re: config is not defined

โพสต์ที่ยังไม่ได้อ่าน โดย Nes224 »

ครับผม ตรงนี้ผมไม่ทราบอะครับ
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41238
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: config is not defined

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

หมายถึงลิงค์นี้ที่ยกมานะครับ
ติดปัญหาคือ การหา path folder ของ module ครับ
ได้ลองทำการค้นดูปัญหาดังกล่าว
ตามลิ้งนี้ครับ >> https://askubuntu.com/questions/1189230 ... de-modules
เป็นของ OS ubuntu

ถ้าติดปัญหา บน windows แล้วไปหาทางแก้บน ubuntu มันจะผิดประเด็น
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ภาพประจำตัวสมาชิก
MBMoo
PHP VIP Members
PHP VIP Members
โพสต์: 25609
ลงทะเบียนเมื่อ: 04/06/2020 10:05 am

Re: config is not defined

โพสต์ที่ยังไม่ได้อ่าน โดย MBMoo »

สามารถใช้งานได้หรือยังคะ
ตอบกลับโพส
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 12