Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR TypeError: Cannot read property 'version' of undefined Vue.js

When I run npm start I get

ERROR  TypeError: Cannot read property 'version' of undefined
TypeError: Cannot read property 'version' of undefined

This happens after I have run

npm install

I tried to solve the issue by running npm -g install npm@version but instead it gave me this error

npm ERR! code ETARGET
npm ERR! notarget No matching version found for npm@version.
like image 599
joash Avatar asked Jan 20 '20 06:01

joash


2 Answers

Did you just upgrade your dependencies directly from 3.0? In v4 eslint is required as a dependency of the project itself. So npm install --save-dev eslint@4 may fix the warning.

like image 146
Mahfujur Rahman Avatar answered Nov 09 '22 18:11

Mahfujur Rahman


From my experience it may happen if there is import of package.json in one of your project's files, but with incorrect path.
Usually, some build related configurations use version property of the package.json.
It is hard to pinpoint the exact issue, since no specifics provided.
First, I'd search stack trace of the error to locate which file is requesting package.json. Global project search for .version should help to find the issue as well.

If you still unable to locate the issue, please, add full error stack trace.

like image 32
aBiscuit Avatar answered Nov 09 '22 19:11

aBiscuit