Serving the application fails - Error: Cannot find module '@nuxtjs/eslint-module'
See original GitHub issueHi there,
trying to use this builder for my nuxt application but I’m getting an error when serving the app.
- works fine with now/static-build
- using nuxt 2.8.1
-
now.json
below - nuxt.config below
- output logs from ZEIT now below
- package.json below
- Deployment URL: https://www-efu6bvof8.now.sh/
now.json
{
"version": 2,
"builds": [
{
"src": "nuxt.config.js",
"use": "@nuxtjs/now-builder",
"config": {}
}
],
"routes": [
{ "src": "/_nuxt/.+", "headers": { "Cache-Control": "max-age=31557600" } },
{ "src": "/(.*)", "dest": "/" }
]
}
Package.json
{
"name": "tresor",
"version": "1.0.0",
"description": "Komm klar mit deinen Finanzen",
"author": "Sumit Kumar",
"private": true,
"scripts": {
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"precommit": "yarn run lint",
"dev": "cross-env NODE_ENV=development nodemon server/index.js --watch server",
"build": "nuxt build",
"now-build": "nuxt build",
"start": "cross-env NODE_ENV=production node server/index.js",
"generate": "nuxt generate"
},
"dependencies": {
"@nuxtjs/axios": "^5.3.6",
"@nuxtjs/bulma": "^1.2.1",
"cross-env": "^5.2.0",
"express": "^4.16.4",
"node-sass": "^4.12.0",
"nuxt": "^2.8.1",
"sass-loader": "^7.1.0",
"vue-focus": "^2.1.0"
},
"devDependencies": {
"@nuxtjs/eslint-config": "^0.0.1",
"@nuxtjs/eslint-module": "^0.0.1",
"babel-eslint": "^10.0.1",
"eslint": "^5.15.1",
"eslint-config-prettier": "^4.1.0",
"eslint-config-standard": ">=12.0.0",
"eslint-plugin-import": ">=2.16.0",
"eslint-plugin-jest": ">=22.3.0",
"eslint-plugin-node": ">=8.0.1",
"eslint-plugin-nuxt": ">=0.4.2",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-promise": ">=4.0.1",
"eslint-plugin-standard": ">=4.0.0",
"eslint-plugin-vue": "^5.2.2",
"nodemon": "^1.18.9",
"prettier": "^1.16.4"
}
}
nuxt.config
module.exports = {
mode: 'universal',
/*
** Headers of the page
*/
head: {
title: 'Tresor - Komm klar mit deinen Finanzen',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{
hid: 'description',
name: 'description',
content: process.env.npm_package_description || ''
}
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
},
/*
** Customize the progress-bar color
*/
loading: { color: '#fff' },
/*
** Global CSS
*/
css: [],
/*
** Plugins to load before mounting the App
*/
plugins: [],
/*
** Nuxt.js modules
*/
modules: [
// Doc:https://github.com/nuxt-community/modules/tree/master/packages/bulma
'@nuxtjs/bulma',
// Doc: https://axios.nuxtjs.org/usage
'@nuxtjs/axios',
'@nuxtjs/eslint-module'
],
/*
** Axios module configuration
** See https://axios.nuxtjs.org/options
*/
axios: {},
/*
** Build configuration
*/
build: {
postcss: {
preset: {
features: {
customProperties: false
}
}
},
/*
** You can extend webpack config here
*/
extend(config, ctx) {}
}
}
Output:
TART RequestId: 7be2acd5-5cf6-44c9-bc89-df5887d1fc3b Version: $LATEST
2019-06-22T11:29:13.419Z 20411dd3-9f6c-48a9-b4c2-b86874142c7a λ Error while initializing nuxt: { /var/task/node_modules/@nuxt/core/dist/core.js:1
Error: Cannot find module '@nuxtjs/eslint-module'
Require stack:
- /var/task/node_modules/@nuxt/core/dist/core.js
- /var/task/now__launcher.js
- /var/runtime/node_modules/awslambda/index.js
at Resolver.requireModule (/var/task/node_modules/@nuxt/core/dist/core.js:627:31)
at ModuleContainer.addModule (/var/task/node_modules/@nuxt/core/dist/core.js:163:36)
at promise.then (/var/task/node_modules/@nuxt/utils/dist/utils.js:1796:43)
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
code: 'MODULE_NOT_FOUND',
requireStack:
[ '/var/task/node_modules/@nuxt/core/dist/core.js',
'/var/task/now__launcher.js',
'/var/runtime/node_modules/awslambda/index.js' ] }
END RequestId: 7be2acd5-5cf6-44c9-bc89-df5887d1fc3b
REPORT RequestId: 7be2acd5-5cf6-44c9-bc89-df5887d1fc3b
Duration: 62.48 ms Billed Duration: 100 ms Memory Size: 3008 MB Max Memory Used: 47 MB
RequestId: 7be2acd5-5cf6-44c9-bc89-df5887d1fc3b Process exited before completing request
Spotted error in output logs:
Error: Cannot find module '@nuxtjs/eslint-module'
Any idea what I might be doing wrong here?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
How do I resolve "Cannot find module" error using Node.js?
Using npm install installs the module into the current directory only (in a subdirectory called node_modules ). Is app.js located under ...
Read more >cannot find module [Node npm Error Solved] - freeCodeCamp
When you get the “cannot find module” error, or “module not found”, it means you've not installed the package you're trying to use....
Read more >关于Error: Cannot find module '@nuxtjs/eslint ... - CSDN博客
1. 删除你的node_moudles目录,然后照着如下的我配置好的package.json(依赖部分)进行重新安装。(PS:NUXT.js(虽然好用)但自带的CLI真滴坑,各种不兼容).
Read more >How to resolve "Cannot find module" error in Node - Sabe.io
The issue is that Node is unable to find the module that you are trying to import into your Node application. The most...
Read more >[Solution] Error: Cannot Find Module "nodemailer" - Courier
What's Causing This Error? This error occurs when you have not installed the nodemailer library in your Node.js application.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @codeofsumit. Please put
@nuxtjs/eslint-module
indevModules
This doesn’t seem to work for google app engine? The only way I can get it work is to move “@nuxtjs/eslint-config”: “^0.0.1”, “@nuxtjs/eslint-module”: “^0.0.1”, into the package.json dependencies.
This is my server file.