electron-vue icon indicating copy to clipboard operation
electron-vue copied to clipboard

Uncaught Error: Cannot find module 'axios'

Open wgqzlj opened this issue 5 years ago • 14 comments

Describe the issue / bug.

# where i run npm run dev, shows "Uncaught Error: Cannot find module 'axios'" in console, and the main window shows nothing.

Uncaught Error: Cannot find module 'axios' at Module._resolveFilename (module.js:543) at Function.Module._resolveFilename (/Volumes/Sites/PDD/pddmigrateclient/pddmigrateclient/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/common/reset-search-paths.js:35) at Function.Module._load (module.js:473) at Module.require (module.js:586) at require (internal/module.js:11) at eval (webpack-internal:///axios:1) at Object.axios (renderer.js:1576) at __webpack_require__ (renderer.js:728) at fn (renderer.js:102) at eval (webpack-internal:///./src/renderer/main.js:3)

If visual, provide a screenshot.

#

Tell me about your development environment.
  • Node version: 12.11.1
  • NPM version:6.11.3
  • vue-cli version: (if necessary) 3.8.4
  • Operating System: MacOS Catalina

If you are looking to suggest an enhancement or feature, then feel free to remove everything above.

wgqzlj avatar Oct 11 '19 10:10 wgqzlj

you are not install axios you can npm install axios -S just try

snail-boy avatar Oct 12 '19 15:10 snail-boy

i meet this problem too! ,I've tried npm install axios -S ,but it not work.

lovelself avatar Nov 16 '19 17:11 lovelself

i meet this problem too. I find a proble for windows. when I tried npm install axios -g, it needed a dependency [email protected]. I try to install, get this error:

npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm ERR! notsup Valid OS: darwin npm ERR! notsup Valid Arch: any npm ERR! notsup Actual OS: win32 npm ERR! notsup Actual Arch: x64

it maybe not fit for windows. so I try to not use axios, when creat a new project.

hotwa avatar Dec 26 '19 12:12 hotwa

Yarn

$ yarn add axios

npm

$ npm install axios --save

esdrasdemorais avatar Jan 07 '20 00:01 esdrasdemorais

I've tried npm install and yarn add,all not work.

JadeAgile avatar Jan 10 '20 07:01 JadeAgile

I've tried npm install and yarn add,all not work.

me too

hhaisYouShan avatar Feb 23 '20 08:02 hhaisYouShan

Has anyone solved it?

luhuaxin avatar Feb 25 '20 07:02 luhuaxin

If you have change webpack config,look#871

BeginsDuang avatar Feb 26 '20 11:02 BeginsDuang

Don't change webpack config just: https://github.com/SimulatedGREG/electron-vue/issues/871#issuecomment-564302194

ghost avatar May 15 '20 05:05 ghost

webpack.renderer.config.js let whiteListedModules = ['vue','axios','vue-electron', 'vue-router', 'vuex', 'vuex-electron','element-ui'] like this......

ChuckWe avatar May 22 '20 01:05 ChuckWe

Ran into this same issue. The whiteListedModules should probably be automatically populated based on the install script options.

GiovanH avatar Oct 07 '20 02:10 GiovanH

webpack.renderer.config.js let whiteListedModules = ['vue','axios','vue-electron', 'vue-router', 'vuex', 'vuex-electron','element-ui'] like this......

It's works for me, thanks!

Vict0r-Chen avatar Oct 15 '20 06:10 Vict0r-Chen

webpack.renderer.config.js let whiteListedModules = ['vue','axios','vue-electron', 'vue-router', 'vuex', 'vuex-electron','element-ui'] like this...... It's works for me, thanks!

liangtongzhuo avatar Oct 16 '20 11:10 liangtongzhuo

did it work for anyone

tarunsankhla avatar Apr 13 '21 19:04 tarunsankhla