core icon indicating copy to clipboard operation
core copied to clipboard

Adonis 4 error on Ignitor file on production which i did not touch that file

Open jbrhinalyn opened this issue 8 years ago • 12 comments

Hi,

I got this error on my server which totally i did not open/edit that file.

at Object. (/var/www/jblhosting.xyz/node_modules/@adonisjs/ignitor/index.js:13:17) 6|server | /var/www/jblhosting.xyz/node_modules/@adonisjs/ignitor/src/Ignitor/index.js:285 6|server | async _bootProviders () { 6|server | ^^^^^^^^^^^^^^ 6|server | SyntaxError: Unexpected identifier 6|server | at createScript (vm.js:56:10) 6|server | at Object.runInThisContext (vm.js:97:10) 6|server | at Module._compile (module.js:542:28) 6|server | at Object.Module._extensions..js (module.js:579:10) 6|server | at Module.load (module.js:487:32) 6|server | at tryModuleLoad (module.js:446:12) 6|server | at Function.Module._load (module.js:438:3) 6|server | at Module.require (module.js:497:17) 6|server | at require (internal/module.js:20:19) 6|server | at Object. (/var/www/jblhosting.xyz/node_modules/@adonisjs/ignitor/index.js:13:17)

No issue in my local. I just really don't know how the cause of it. Version on my server nodejs version is v9.11.1 npm version is 5.6.0

Adonis 3.2, no problem at all. Only this latest version which i have that problem.

jbrhinalyn avatar Apr 23 '18 14:04 jbrhinalyn

I only get this error if I use a node version that doesn't support Async/Await

webdevian avatar Apr 23 '18 14:04 webdevian

i'm using nodejs v9.11.1

jbrhinalyn avatar Apr 23 '18 14:04 jbrhinalyn

nodejs version in my laptop is v8.9.1 which is working. maybe i have to downgrade to that version.

jbrhinalyn avatar Apr 23 '18 14:04 jbrhinalyn

It should work on 9.x too.

How are you detecting the version on your server? Try adding console.log(process.version) into server.js just to check the version the script is actually being run under

webdevian avatar Apr 23 '18 14:04 webdevian

the app die right away after pm2 restart server.js screenshot_7

jbrhinalyn avatar Apr 23 '18 14:04 jbrhinalyn

i downgrade my nodejs version to v8.9.1 same with my local node version and the problem are still the same. :(

jbrhinalyn avatar Apr 23 '18 14:04 jbrhinalyn

It could be a problem with PM2. What happens if you run server.js directly in the command line?

webdevian avatar Apr 23 '18 14:04 webdevian

this is the display which i think is working since that console you suggested display. screenshot_8

jbrhinalyn avatar Apr 23 '18 14:04 jbrhinalyn

Yes that looks right. Then the app starts serving ok?

webdevian avatar Apr 23 '18 14:04 webdevian

No. The solution was to upgrade to latest version of NPM. Its working now with latest version of NPM. Thanks @webdevian . Really appreciate it. 😄

jbrhinalyn avatar Apr 23 '18 14:04 jbrhinalyn

Closing now this ticket since issue is been resolve and not related to AdonisJS.

jbrhinalyn avatar Apr 23 '18 14:04 jbrhinalyn

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Mar 11 '20 06:03 lock[bot]