How Can I Uninstall browser-sync - npm

I tried uninstalling browser-sync and it simply won't work.
I've tried multiple times and already looked at these questions:
Can't uninstall global npm packages after installing nvm
How to uninstall npm modules in node js?
I tried adding -g and it just says it's "up to date"...
>npm uninstall browser-sync
npm ERR! code EJSONPARSE
npm ERR! file C:\Users\justi\OneDrive\Documents\GitHub\triangle-calc\package.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected token } in JSON at position 316 while parsing near '...les.css --watch",
npm ERR! JSON.parse },
npm ERR! JSON.parse "keywords": [],...'
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\justi\AppData\Roaming\npm-cache\_logs\2020-12-28T01_44_57_830Z-debug.log
>npm uninstall browser-sync -g
up to date in 0.063s
I haven't had this problem uninstalling anything else before. I'm hoping posting here someone will quickly find my stupid mistake. Thanks in advance.

There was an error in my package.json (admittedly as the output says). It was an extra comma (apparently that works in JS but not JSON). Leaving this up in case it helps someone else trying to uninstall a package.

Related

How can I solve an error while using npm install?

I just wanna install dependencies for my project after cleaning "node_module" folder and deleting package-lock.json file:
npm install
And always get an error:
npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name "^" of package "eslint-plugin-react#^": Tags may not have
any characters that encodeURIComponent encodes.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Admin\AppData\Local\npm-cache\_logs\2023-01-31T16_45_46_763Z-
debug-0.log
and the same error when using yarn.

Got errs with puppeteer and node-sass running npm i

I have a double problem.
The work environment is in Vue and Nuxt, with a mac M1 pro.
Until last week, I had no problems, everything was running perfect. They changed my mac and the world stopped running.
I download 2 repos, but when running npm i, one explodes with puppeteer and the other with node-sass.
npm ERR! code ELIFECYCLE npm ERR! error 1 npm ERR! puppeteer#8.0.0 install:nodeinstall.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the puppeteer#8.0.0 install script.
npm ERR! code ELIFECYCLE npm ERR! error 1 npm ERR! node-sass#4.14.1 postinstall: node scripts/build.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-sass#4.14.1 postinstall script.
I am using the correct version of Node.
I tried deleting the package-lock.json and the node_modules, clearing the npm cache, and running npm i again, and no, it breaks.
I tried installing those specific packages outside of npm i, and I get the same error.
I tried creating a .npmrc file with
registry=https://registry.npmjs.org always-auth=true //registry.npmjs.org/: "token"
I am using the same package.json and the same repos as my peers. They also have mac M1 and have no problem.
On Github we have the same permissions.
Any idea what is happening?
Thank you very much in advance \o/
You can use sass instead of node-sass. This is because node-sass has been deprecated.
npm uninstall node-sass
npm install sass
Works all the same, no need to make any other changes

npm install --save solc on Atom

When I type npm install --save solc in the comment prompt on the mac, it's like
And after these a package is downloaded. I am a windows user and I tried to do this. I have an error like
C:\Users\senem\Desktop\inbox>npm install --save solc
npm ERR! code EJSONPARSE
npm ERR! file C:\Users\senem\Desktop\inbox\package.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected end of JSON input while parsing near ''
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\senem\AppData\Roaming\npm-cache_logs\2021-03-04T23_05_05_768Z-debug.log
I can't download it because I don't know which package it is. Is there anyone who can help? How can I download this or how can I solve this error?

npm not installing packages when i want to

Most of the times when I try to install a package, I get this message:
npm ERR! Unexpected string in JSON at position 117 while parsing '{
npm ERR! "requires": true,
npm ERR! "lockfileVersion'
What is happening?
Your package.json must be of valid json syntax. If you're sure nothing is wrong with it , then it could be your package-lock.json file that is corrupted.delete it and run npm install again.

Atom editor Package installation error

I got an error when i install packages in Atom
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "C:\\Users\\Jarvis\\AppData\\Local\\atom\\app-1.5.3\\resources\\app\\apm\\bin\\node.exe" "C:\\Users\\Jarvis\\AppData\\Local\\atom\\app-1.5.3\\resources\\app\\apm\\node_modules\\npm\\bin\\npm-cli.js" "--globalconfig" "C:\\Users\\Jarvis\\.atom\\.apm\\.apmrc" "--userconfig" "C:\\Users\\Jarvis\\.atom\\.apmrc" "install" "C:\\Users\\Jarvis\\AppData\\Local\\Temp\\d-116128-3752-1lwywgv\\package.tgz" "--target=0.34.5" "--arch=ia32"
npm ERR! node v0.10.40
npm ERR! npm v2.13.3
npm ERR! file C:\Users\Jarvis\.atom\.apm\nopt\3.0.6\package\package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! Unexpected token '\u0000' at 1:1
npm ERR!
npm ERR! ^
npm ERR! File: C:\Users\Jarvis\.atom\.apm\nopt\3.0.6\package\package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse
I am trying to install lots of packages in atom Editor but i got above error.
If you open the C:\Users\Jarvis\.atom\.apm\nopt\3.0.6\package\package.json with Notpad++ ( or any other editor your choice - just don't do it in atom, it will crash, at least in Version 1.6.2 it did for me ) and look for the non printable characters. You will see that the file contain a lot of NUL. I had the same error suddenly one day, when trying to install updates for my packages.
Here is what i did to resolve the error. Be warned however that you have to install all packages again. Personally i use sync-settings (which backups my packages etc.), so it was no big deal for me.
Delete the entire C:\Users\Jarvis.atom\packages folder
Delete the entier C:\Users\Jarvis.atom.apm folder
Reinstall all packages (.apm folders will then installed automatically)
It can be hard to delete those folders because of the Path too long restriction. In this case there helps a Stackexchange answer: How to delete a file in Windows with a too long filename?