Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to install reactjs and vue in Laravel 8. So after

php artisan ui react
php artisan ui vue

I input

npm install
npm run dev

and get this error message

C:xampphtdocsonlinepaint
ode_modulescross-envsrcindex.js:23
    )
    ^
SyntaxError: Unexpected token )
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:xampphtdocsonlinepaint
ode_modulescross-envsrcincross-env.js:3:18)
    at Module._compile (module.js:570:32)

npm ERR! Windows_NT 10.0.18363
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "development"
npm ERR! node v6.9.2
npm ERR! npm  v3.10.9

I did try npm cache clear --force and code above again, but get the same result.

question from:https://stackoverflow.com/questions/66059146/laravel-8-cannot-run-npm-run-dev

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
384 views
Welcome To Ask or Share your Answers For Others

1 Answer

Try to update node:

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

Then:

rm -rf node_modules && npm cache clean --force && npm install

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...