How are you attempting to import and use axios in your project?
Jan 17, 2020
4
Level 8
Can't find axios module ? Module build failed: Error: ENOENT: no such file or directory
I'm getting the following error in my laravel-vue app:
Error: Module build failed: Error: ENOENT: no such file or directory, open 'C:\xampp\htdocs\candemtown.es\node_modules\axios\index.js
Pretty weird considering I can see the file is there, I tried deleting node_modules and package-lock.json and doing a npm install again but I keep getting the error.
My package.json file:
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"babel-eslint": "^8.2.6",
"babel-plugin-dynamic-import-webpack": "^1.1.0",
"babel-preset-env": "^1.7.0",
"bootstrap": "^4.0.0",
"cross-env": "^5.1",
"laravel-mix": "^4.0.15",
"popper.js": "^1.12",
"resolve-url-loader": "^2.3.2",
"sass": "^1.17.2",
"sass-loader": "^7.1.0"
},
"dependencies": {
"axios": "^0.18.1",
"chart.js": "^2.8.0",
"jquery": "^3.4.1",
"lodash": "^4.17.15",
"vue": "^2.6.8",
"vue-moment": "^4.1.0",
"vue-parallaxy": "^1.1.1",
"vue-slick": "^1.1.15",
"vue-template-compiler": "^2.6.8",
"vue2-datepicker": "^2.6.4",
"vue2-editor": "^2.6.6",
"vuex": "^3.1.0",
"vuex-persistedstate": "^2.5.4"
}
}
Please or to participate in this conversation.