node.js - Why am I getting Unexpected token '\u0000' when using npm install -g package -


this windows specific issue haven't found information when googling issue. had been using ionic framework relies on cordova (or phonegap). however, problem not specific of these packages. see error quite often. so, error when run command such following:

npm install -g cordova 

however, substitute various other packages , same error. i'll paste snippet (very brief) below of error message. strange had ionic project working in directory earlier. today told me ionic not found. hunch different issue main issue describing here.

i installed git bash have linux-like environment try. select git bash bash window various bash commands. if there easier way fix windows users, please let me know. have seen courses on pluralsight instructors seem happily using npm no problems. also, when use yeoman, @ point, in many cases, same error.
error

npm err! failed parse json npm unexpected token '\u0000' @ 1:1 npm err! npm err! ^ npm err! file: c:\users\bruce\appdata\roaming\npm-cache\amdefine\1.0.0\package\package.json npm err! failed parse package.json data. npm err! package.json must actual json, not javascript. npm err! npm err! not bug in npm npm err! tell package author fix package.json file. json.parse. 

thanks in advance help/advice, bruce

via this question on so have do:

npm cache clean.

but, try other methods suggested there adding registry option:

npm install <packagename> --registry http://registry.npmjs.org/.

or, if you've been mingling package.json file yourself, check if it's valid.


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -