Home > database >  NPM INSTALL / RUN SERVE PROBLEM IN VS CODE
NPM INSTALL / RUN SERVE PROBLEM IN VS CODE

Time:11-08

So this problem happens when I upload a project to VS CODE and in terminal type npm install and npm run serve. This is VUE project...

npm ERR! code ENOENT

npm ERR! syscall open

npm ERR! path C:\Users\ivana\OneDrive\Радна површина\Udemy\prj-cmp-01-starting-setup (2)/package.json

npm ERR! errno -4058

npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\ivana\OneDrive\Радна површина\Udemy\prj-cmp-01-starting-setup (2)\package.json'

npm ERR! enoent This is related to npm not being able to find a file.

npm ERR! enoent

npm ERR! A complete log of this run can be found in:

npm ERR! C:\Users\ivana\AppData\Local\npm-cache_logs\2021-11-07T13_12_37_433Z-debug.log PS C:\Users\ivana\OneDrive\Радна површина\Udemy\prj-cmp-01-starting-setup (2)>

CodePudding user response:

It seems that, in your project, there is a file package.json missing. In order to solve this, you can try these commands:

Step 1 - npm init - this will create the missing package.json file OR npm init -yes for creating a default package.json file

Step 2 - npm install

Further information about this solution, you can go to this website: https://www.cloudhadoop.com/2018/10/fix-for-error-packagejson-not-found-in.html

CodePudding user response:

How you create your vue app?

If you dont have vue-cli you run this linge in your terminal to install global vue-cli:

npm i -g @vue/cli

when cli is instaled you can run:

vue create my-app

after that you chose what you want in your app: vue 2 or 3, router or not etc...

when all is instaled you have 2 comands to do;

cd my-app

to entry in your app

npm run serve

to run serve in your app Normally when you respect this it should works.

  • Related