Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after running npm run dev getting this error #44

Open
Celina-new opened this issue Jun 23, 2020 · 3 comments
Open

after running npm run dev getting this error #44

Celina-new opened this issue Jun 23, 2020 · 3 comments

Comments

@Celina-new
Copy link

{ 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! [email protected] dev: webpack-dev-server --config ./webpack/webpack-dev.config.js --watch --colors
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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
Copy link

Xoagub commented Sep 6, 2020

Where you able to fix it ?

@NeoRivets
Copy link

NeoRivets commented Sep 6, 2020 via email

@ram-adhikari-at-wify
Copy link

ram-adhikari-at-wify commented Jan 13, 2021

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.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants