I want to run my Vue.js using npm on localhost:8080 but they give me this error. Is there a way to solve this issue?
This error only occurs when I tried to install node_modules and package-lock.json in my Vue folder containing .babelrc, package.json and webpack.config.js. For my other Vue folders, I still can run my localhost:8080 by using the same method for all folders which is
npm install
npm run dev
The code below is the Error.
The system cannot find the path specified.
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'C:\Users\acer\Documents\VueJs\cross-env\dist\bin\cross-env.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-cli@ dev: `cross-env NODE_ENV=development webpack-dev-server --open --inline --hot`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-cli@ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\acer\AppData\Roaming\npm-cache\_logs\2019-08-23T06_50_37_455Z-debug.log
Before you go uninstalling everything, try closing the terminal and trying again in a new Terminal instance
I had a similar issue which I solved by noticing that when I followed the advice here: https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/1056#issuecomment-699456515
and proceeded to run npm run build
which is what was giving me that error, it would work inside of the newly created project with vue create <project-name>
.
I had my code in a repository so I recloned it, copied the node_modules folder into my working directory and then ran it again and it worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With