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.
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.
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.
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