1

I have a problem with installing vue3 alpha via npm. I tried to do this:

mkdir myprj && cd myprj
npm init -y
npm install laravel-mix --save-dev
npm install cross-env
cp node_modules/laravel-mix/setup/webpack.mix.js ./
npm install vue@3.0.0-rc.13
mkdir src
echo 'import { createApp } from \'vue\'' > src/app.js

my webpack.mix.js file content:

let mix = require('laravel-mix');
mix.js('src/app.js', 'dist/');

my package.json:

{
  "name": "vue33",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "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",
    "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"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "vue": "^3.0.0-rc.13"
  },
  "devDependencies": {
    "cross-env": "^7.0.2",
    "laravel-mix": "^6.0.0-alpha.1",
    "resolve-url-loader": "^3.1.0",
    "sass": "^1.26.11",
    "sass-loader": "^8.0.2",
    "vue-template-compiler": "^2.6.12"
  }
}

Now I'm trying to start the process, but it fails:

npm run watch

=> webpack: Module not found: Error: Can't resolve 'vue' in '/home/frontend/vue33/src'

But the module is installed, and the folder node_modules/vue exists. And with vue2 all works correctly. What does this mean?

Boussadjra Brahim
  • 82,684
  • 19
  • 144
  • 164
novascriptum
  • 11
  • 1
  • 2
  • Does this answer your question? [Install vue 3.0 in laravel](https://stackoverflow.com/questions/63967346/install-vue-3-0-in-laravel) – Boussadjra Brahim Sep 20 '20 at 14:30
  • Yes, it works! That's magic! It doesn't work with the current next version of laravel-mix, but works with the current stable version. – novascriptum Sep 21 '20 at 02:44

0 Answers0