How to resolve an error with npm run serve

Viewed 2231

I am new to Vue. I had successfully created projects for a while now, with no issues. However, today I created a new project, and when I tried “npm run serve” I got back three errors out of nowhere. Even old projects that were serving fine, I cant serve them again

I am using windows 7, so the node version is 13.14.0 This is the error I get: ERROR Failed to compile with 3 errors
10:46:02 PM

ERROR  Failed to compile with 3 errors                                                                                                                    
10:46:02 PM

These dependencies were not found:

 * C:\Users\hp\Documents\vue full learn\dojo-blog- 
  composition\node_modules\webpack-dev-server\client\index.js? 
  http://192.168.43.35:8081&sockPath=/sockjs-node in multi
  (webpack)-dev-server/client? 
  http://192.168.43.35:8081&sockPath=/sockjs-node 
  (webpack)/hot/dev-server.js ./src/main.js
  * C:\Users\hp\Documents\vue full learn\dojo-blog- 
  composition\node_modules\webpack\hot\dev-server.js in multi 
  (webpack)-dev-server/client? 
  http://192.168.43.35:8081&sockPath=/sockjs-node 
  (webpack)/hot/dev-server.js ./src/main.js

    To install them, you can run: npm install --save 
    C:\Users\hp\Documents\vue full learn\dojo-blog- 
   composition\node_modules\webpack-dev- 
    server\client\index.js? 
   http://192.168.43.35:8081&sockPath=/sockjs-node 
    C:\Users\hp\Documents\vue full learn\dojo-blog- 
    composition\node_modules\webpack\hot\dev-server.js


   This relative module was not found:

  * ./src/main.js in multi (webpack)-dev-server/client? 
   http://192.168.43.35:8081&sockPath=/sockjs-node 
    (webpack)/hot/dev-server.js ./src/main.js

I checked and the webpack-dev-server is in the node-bundles folder. when I tried installing as directed above, I got more errors:

npm ERR! code ENOLOCAL
npm ERR! Could not install from "..\..\..\Documents\vue" as it 
does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\hp\AppData\Roaming\npm- 
cache\_logs\2021-01-02T22_03_20_183Z-debug.log
'sockPath' is not recognized as an internal or external command,
operable program or batch file.

This is the package.json

{
  "name": "project-planner",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build"
  },
  "dependencies": {
    "core-js": "^3.6.5",
    "vue": "^3.0.0",
    "vue-router": "^4.0.0-0"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-router": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "@vue/compiler-sfc": "^3.0.0",
    "webpack-dev-server": "^3.11.2"
  }
}

I get this with I use npm install

npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated

> core-js@3.8.3 postinstall C:\Users\hp\My Documents\webdev\projects\learnVue\project-planner\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> ejs@2.7.4 postinstall C:\Users\hp\My Documents\webdev\projects\learnVue\project-planner\node_modules\ejs
> node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.1 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\watchpack-chokidar2\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\webpack-dev-server\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})

added 1214 packages from 934 contributors and audited 1217 packages in 527.888s

61 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
0 Answers
Related