haej
haej

Reputation: 51

npm ERR! Cannot read property '0' of undefined using npm version 5.8.0

I attempted to install the beta version of material-ui for my React/Typescript application using the command npm install material-ui@next and got the result below:

npm ERR! Cannot read property '0' of undefined npm ERR! A complete log of this run can be found in: https://pastebin.com/rD0CRd24

Is this a bug with npm? What should I be concluding based on this error message and how can I fix it to successfully install?

Upvotes: 1

Views: 1142

Answers (1)

haej
haej

Reputation: 51

I fixed the issue by running the following commands (without having to downgrade from version 6.9.1 of npm):

rm -rf node_modules/
rm package-lock.json
npm install
npm install material-ui@next

npm install was followed by a lot of depracated warnings about Canvas/libstd/minimatch/graceful-fs, but still worked in the end.

Upvotes: 1

Related Questions