Reputation: 6123
After installing Node 5, I am getting an error in the terminal everytime I run whatever with npm
npm -v: 2.14.12
and here I am trying to update npm to the last version:
MacBook-Pro-de-MarceloRS:promo-auto-loans-1 Marcelo$ sudo npm install npm -g
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "npm" "-g"
npm ERR! node v5.0.0
npm ERR! npm v3.3.6
npm ERR! code EINVALIDTYPE
npm ERR! typeerror Error: Argument #1: Expected string but got object
npm ERR! typeerror at markDeps (/usr/local/lib/node_modules/npm/lib/install/deps.js:87:5)
npm ERR! typeerror at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:35
npm ERR! typeerror at Array.forEach (native)
npm ERR! typeerror at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:11
npm ERR! typeerror at Array.forEach (native)
npm ERR! typeerror at asyncMap (/usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:51:8)
npm ERR! typeerror at Array.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/slide/lib/bind-actor.js:15:8)
npm ERR! typeerror at LOOP (/usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:15:14)
npm ERR! typeerror at chain (/usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:20:5)
npm ERR! typeerror at recalculateMetadata (/usr/local/lib/node_modules/npm/lib/install/deps.js:112:3)
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror <http://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Marcelo/Documents/Projects/BankOfAmericaApps/promo-auto-loans-1/npm-debug.log
and I get the same error of npm ERR! code EINVALIDTYPE
whatever I run npm xxxx.
Any suggestions ?
Upvotes: 1
Views: 2403
Reputation: 423
I manually added the package name (@materia-ui/core) in the package.json and ran npm install
once in the root directory and once in subdirectory (We have a mono-repo with lerna) and it worked. I have no idea how and why.
Don't forget to remove package-lock.json
and node_modules
Upvotes: 0
Reputation: 126
same issue happend to me.
first i deleted the node_modules folder and then the package-lock.json file but the problem still persisted.
when i looked at my package.json file for some irregularities i noticed a dependency that was just an empty string - something like: "dependencies": {..., "": "^5.3.1" ,...}.
once i deleted that empty dependency, npm was running again.
hope this helps someone :)
Upvotes: 2
Reputation: 1298
I simply deleted both the node_modules
folder as well as the package-lock.json
file and then rerun module installation with npm.
rm -rf node_modules
& then rm -rf package-lock.json
and finally npm install
Upvotes: 0
Reputation: 51
I had the same issue on my linux machine. I upgraded my node from 5.0.0 to 5.1.0 and now works like a charm.
Upvotes: 5