So I have been getting this NPM error and I cannot figure out why just VUE cannot be resolved. I am using Laravel 5.6. This is a new install of Laravel with some light web pack configuration. I have resolved path in webpackConfig to VUE and I believe it is failing at the extract step in the webpack.mix.js
Package.json
{
"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": {
"@vue/test-utils": "^1.0.0-beta.10",
"axios": "^0.18",
"babel-jest": "^22.1.0",
"bootstrap": "^4.1.3",
"cross-env": "^5.1",
"jquery": "^3.2",
"laravel-mix": "^2.0",
"lodash": "^4.17.5",
"pace": "github:HubSpot/pace#v1.0.2",
"perfect-scrollbar": "^1.4.0",
"popper.js": "^1.14.4",
"simple-line-icons": "^2.4.1",
"sweetalert2": "^7.0.7",
"vue": "^2.5.17"
},
"dependencies": {
"imagemin": "^6.0.0"
}
}
webpack.mix.js
let mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.setPublicPath('public');
/*
|--------------------------------------------------------------------------
| Webpack Config
|--------------------------------------------------------------------------
*/
mix.webpackConfig({
resolve: {
modules: [
path.resolve(__dirname, 'node_modules/bootstrap/dist'),
path.resolve(__dirname, 'node_modules/jquery/dist'),
path.resolve(__dirname, 'node_modules/vue'),
path.resolve(__dirname, 'node_modules/axios/dist'),
path.resolve(__dirname, 'node_modules/lodash'),
path.resolve(__dirname, 'node_modules/sweetalert2/dist'),
path.resolve(__dirname, 'node_modules/popper.js/dist')
]
}
});
/*
|--------------------------------------------------------------------------
| Vendor Extraction
|--------------------------------------------------------------------------
*/
mix.extract([
'vue',
'jquery',
'axios',
'sweetalert2',
'lodash',
'js/bootstrap',
'popper.js'
]);
/*
|--------------------------------------------------------------------------
| Autoload Dependancies
|--------------------------------------------------------------------------
*/
mix.autoload({
jquery: ['$', 'window.jQuery', 'jQuery']
});
/*
|--------------------------------------------------------------------------
| Mix App Resources
|--------------------------------------------------------------------------
| app.js | Application Javascript file
| app.scss | Applciation SCSS file
*/
mix
.js(['resources/js/app.js'], 'public/js')
.sass('resources/sass/app.scss', 'public/css');
/*
|--------------------------------------------------------------------------
| Mix In Production
|--------------------------------------------------------------------------
*/
if (mix.inProduction() || process.env.npm_lifecycle_event !== 'hot') {
mix.version();
}
NPM Error
ERROR in multi vue jquery axios sweetalert2 lodash js/bootstrap popper.js
Module not found: Error: Can't resolve 'vue' in '/Path/To/Project/Project-Folder'
@ multi vue jquery axios sweetalert2 lodash js/bootstrap popper.js
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2O2iEVF
via IFTTT
Aucun commentaire:
Enregistrer un commentaire