简体   繁体   中英

npm ERR! Cannot read property 'version' of null

I can't install anything in it, tried solutions in here but did not work any either.

$ npm install axios
npm ERR! Cannot read property '**version**' of null

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\\AppData\Local\npm-cache\_logs\2021-08-26T13_54_26_790Z-debug.log

Try to cleanup node cache and remove node_modules:

$ npm cache clean --force
$ rm -rf node_modules

After try to run npm install axios.

this error generally came when you used any deprecated library on your project. so just go through your package.json file and remove those deprecated library which you have been used...

simply remove that versions from package.json and do

npm i --legacy-peer-deps

if it will not resolved then try run this

npm install axios --legacy-peer-deps

can you please check your npmlockversion in the package-lock.json, and you npm version?

if you are using npmlockversion 3 you should use npm version higher than 7.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM