1

Newbie node question. I am not able to get my project running anymore.

{ "name": "MyApp", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "node app.js dev2" }, "author": "", "license": "ISC", "dependencies": { "async-await": "^0.1.32", "asyncawait": "^1.0.3", "body-parser": "^1.14.2", "deasync": "", "ejs": "^2.4.1", "express": "^4.13.4", "gulp": "^3.9.0", "gulp-concat": "", "gulp-filelist": "^0.2.0", "gulp-foreach": "^0.1.0", "gulp-remove-files": "0.0.3", "gulp-rename": "", "gulp-uglify": "", "gulp-watch": "^4.3.5", "mongoose": "^4.4.1", "mongoose-ttl": "0.0.3", "node-inspector": "^0.12.5", "promise": "^7.1.1", "rootpath": "^0.1.2" }, "devDependencies": { "browser-sync": "^2.11.1", "gulp": "^3.9.1" } }

1726 error Failed to parse json
1726 error Unexpected token '\u0000' at 1:1
1726 error 
1726 error ^
1727 error File: C:\Users\dir\AppData\Roaming\npm-cache\accepts\1.2.13\package\package.json
1728 error Failed to parse package.json data.
1728 error package.json must be actual JSON, not just JavaScript.

1 Answer 1

1

error Unexpected token '\u0000' at 1:1

seems that u have null character at first line and 1 character

can u provide package.json on pastebin or similar?

Sign up to request clarification or add additional context in comments.

6 Comments

I browsed to the file and I all I see is a bunch of null strings! This is leading to something. I am not sure how that file got messed up. I tried deleting it and I get a different error after it creates a new one
npm ERR! Windows_NT 10.0.10586 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" npm ERR! node v4.3.2 npm ERR! npm v2.14.12 npm ERR! file C:\Users\dir\AppData\Roaming\npm-cache\escape-html\1.0.3\package\package.json npm ERR! code EJSONPARSE npm ERR! Failed to parse json npm ERR! Unexpected token '\u0000' at 1:1
looks like every new file it points to has a bunch of null strings null null null null null null....
Also, just checkout files using git/svn/etc
Ok fixed it by uninstalling node and removing the following directories "C:\Users\dir\AppData\Roaming\npm" and "C:\Users\dir\AppData\Roaming\npm-cache" then installing node again. However, I am not sure what caused it, I use brackets as my editor.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.