there is been trying to use vue.js for the past 3-4 hours now and it is feeling like an uphill battle to just get it set up.
when following this documentation: https://cli.vuejs.org/guide/creating-a-project.html#vue-create
there is the following library versions on my computer
macOS Mojave 10.14.5
node -v v10.16.0
npm -v 6.9.0
vue.js –version 3.8.3
My problem is below.
$ vue.js create hello-world
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module ‘./fs’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/usr/local/lib/node_modules/@vue/cli/node_modules/fs-extra/lib/index.js:6:3)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
Any help would be appreciated.
I tried Node version 10.15.3 because some people had luck with it here
https://github.com/vuejs/vue-cli/issues/3879
Solution :
It was a pretty simple fix and it had nothing to do with the versions I was running. Assuming you have used npm install -g @vue/cli and are using a mac you should be able to do:
sudo chown -R $(whoami) /usr/local/lib
Then for a fresh start do this again.
npm uninstall -g @vue/cli
npm install -g @vue/cli
Comment if it did not work and I will try my best to help you.