gazpachu / hypatia

A JavaScript open source LMS (eLearning platform) for MOOCs and online courses
https://joanmira.com/hypatia
Other
628 stars 273 forks source link

after running npm run dev getting this error #44

Open Celina-new opened 4 years ago

Celina-new commented 4 years ago

{ Error: ENOENT: no such file or directory, open '.env' at Object.openSync (fs.js:443:3) at Object.readFileSync (fs.js:343:35) at Object.config (/Users/sunil/Desktop/new project/nekomy-platform/node_modules/dotenv/lib/main.js:30:37) at Object. (/Users/sunil/Desktop/new project/nekomy-platform/webpack/webpack.config.js:1:19) at Module._compile (internal/modules/cjs/loader.js:776:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:690:17) errno: -2, syscall: 'open', code: 'ENOENT', path: '.env' } Project is running at http://localhost:8080/ webpack output is served from / Content not from webpack is served from /Users/sunil/Desktop/new project/nekomy-platform 404s will fallback to /index.html fs.js:128 throw new ERR_INVALID_CALLBACK(); ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function at maybeCallback (fs.js:128:9) at Object.writeFile (fs.js:1163:14) at VersionFile.writeFile (/Users/sunil/Desktop/new project/nekomy-platform/node_modules/webpack-version-file-plugin/index.js:54:8) at /Users/sunil/Desktop/new project/nekomy-platform/node_modules/webpack-version-file-plugin/index.js:42:18 at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! nekomy@0.1.10 dev: webpack-dev-server --config ./webpack/webpack-dev.config.js --watch --colors npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the nekomy@0.1.10 dev 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/sunil/.npm/_logs/2020-06-23T11_11_50_796Z-debug.log

Xoagub commented 3 years ago

Where you able to fix it ?

NeoRivets commented 3 years ago

Unfortunately not. I think that it is due to the application code rather than the configuration of plesk.

Thanks

From: Xoagub notifications@github.com Reply-To: nekomy/nekomy-platform reply@reply.github.com Date: Sunday, September 6, 2020 at 2:22 PM To: nekomy/nekomy-platform nekomy-platform@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [nekomy/nekomy-platform] after running npm run dev getting this error (#44)

Where you able to fix it ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/nekomy/nekomy-platform/issues/44#issuecomment-687861920, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AF6PJXOAAWTH5KAUW6HDRZLSEPHPHANCNFSM4OFSN54Q.

ram-adhikari-at-wify commented 3 years ago

I feel this has to do with the ejs script attempting to update the version number. Since I was trying this out in local, the version thingy was not critical to me....so i went and commented out the version update logic :

File to edit: /webpack/webpack.config.js Line number: 66

The initial version was :

plugins: [
   new WebpackVersionFilePlugin({
    packageFile: Path.join(__dirname, '../package.json'),
    template: Path.join(__dirname, '../version.ejs'),
    outputFile: Path.join(__dirname, '../static/version.json')
  }), 

I commented out the first array element, post commenting, it was

plugins: [
  /*new WebpackVersionFilePlugin({
    packageFile: Path.join(__dirname, '../package.json'),
    template: Path.join(__dirname, '../version.ejs'),
    outputFile: Path.join(__dirname, '../static/version.json')
  }), */

That solved this problem.....