1. Background:
Run in PowerShell: PS e: \ vscode \ Vue \ day4 \ code \ myapi & gt; nodemon . \index. JS
error reporting
2. Error reporting content:
PS E:\vscode\vue\day4\code\myapi> node .\index.js
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module './application'
Require stack:
- E:\vscode\vue\day4\code\myapi\node_modules\express\lib\express.js
- E:\vscode\vue\day4\code\myapi\node_modules\express\index.js
- E:\vscode\vue\day4\code\myapi\index.js
[90m at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)[39m
[90m at Function.Module._load (node:internal/modules/cjs/loader:778:27)[39m
[90m at Module.require (node:internal/modules/cjs/loader:1005:19)[39m
[90m at require (node:internal/modules/cjs/helpers:102:18)[39m
at Object.<anonymous> (E:\vscode\vue\day4\code\myapi\node_modules\[4mexpress[24m\lib\express.js:18:13)
[90m at Module._compile (node:internal/modules/cjs/loader:1101:14)[39m
[90m at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)[39m
[90m at Module.load (node:internal/modules/cjs/loader:981:32)[39m
[90m at Function.Module._load (node:internal/modules/cjs/loader:822:12)[39m
[90m at Module.require (node:internal/modules/cjs/loader:1005:19)[39m {
code: [32m'MODULE_NOT_FOUND'[39m,
requireStack: [
[32m'E:\\vscode\\vue\\day4\\code\\myapi\\node_modules\\express\\lib\\express.js'[39m,
[32m'E:\\vscode\\vue\\day4\\code\\myapi\\node_modules\\express\\index.js'[39m,
[32m'E:\\vscode\\vue\\day4\\code\\myapi\\index.js'[39m
]
}
3. Solution:
1. Prompt for finding the error point: error: cannot find module ‘/ application’
2. According to the error prompt, baidu solved the first blog
4. Causes:
Execute node \index. JS, PowerShell did not find ‘/ Application ‘this module should be index JS file runtime calls
node_ The dependent module in the modules folder is not found, so an error is reported
5. Solution:
1. Delete node_Modules folder (because dependencies are placed here)
2 There is a package Run in the folder of JSON file: PS e:\vscode\Vue\day4\code\myapi > npm install
3. The previous step is based on package JSON file re download dependency
Read More:
- How to Solve Nodejs error: cannot find module ‘. /application’
- Node.js Error: Error: Cannot find module ‘express‘ [How to Solve]
- [Solved] ERROR Error: Cannot find module ‘vue-loader-v16/package.json‘
- The vue3 project Error: Cannot find module’vue-loader-v16/package.json’
- Node.js Error: Cannot find module express [How to Solve]
- [Solved] Syntax Error: Error: Loading PostCSS Plugin failed: Cannot find module ‘autoprefixer‘
- [Solved] Error: Cannot find module ‘@vue/cli-shared-utils
- Module build failed: Error: Couldn’t find preset “es2015” relative to directory
- [webpack-cli] Error: Cannot find module ‘vue/compiler-sfc‘
- [Solved] Error: Cannot find module ‘@vue/cli-shared-utils‘
- Error Cannot find module ‘worker_threads‘ [How to Solve]
- [Solved] Vue Project Error: Error: Cannot find module ‘webpack‘ Require stack以及Error: Rule can only have one resource so
- [Solved] Syntax Error: Error: Cannot find module ‘cache-loader‘
- [Solved] Error: Cannot find module ‘vue-template-compiler/package.json‘ Require stack:
- [Solved] Error: Cannot find module ‘@/views/xxx‘ at webpackEmptyContext
- [Solved] Node error: Error: Cannot find module ‘body-parser‘
- Can’t resolve ‘ansi-html-community’ & Cannot find module ‘is-docker (vuex-persistedstate Installed)
- When starting Vue project: cannot find module ‘webpack cli/bin/config yargs’ error resolution
- Vue project Run Error: Syntax Error: Error: Cannot find module ‘less‘
- Syntax Error: Error: Cannot find module ‘less‘ [How to Solve]