I cannot install Webpack using npm - javascript

Every time I use npm install --save-dev webpack, the command line throws an error saying this:
npm ERR! Unexpected end of JSON input while parsing near '...it","version":"1.4.0"'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\usman\AppData\Roaming\npm-cache\_logs\2020-05-20T02_38_55_455Z-debug.log
I have tried rebooting my PC, install the webpack cli, re-installing Node.js but nothing seems to work. Please help.

Related

I encountered a problem when installing Next JS

I was installing NextJS when I encountered the following error:
D:\Codes\React\Learn>npx create-next-app
npm WARN using --force Recommended protections disabled.
npm WARN using --force Recommended protections disabled.
npm ERR! code E404
npm ERR! 404 File Not Found - GET https://skimdb.npmjs.com/registry/create-next-app
npm ERR! 404
npm ERR! 404 'create-next-app#latest' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Local\npm-cache\_logs\2023-02-06T12_41_40_938Z-debug-0.log
Can anyone help me?
I wanted to work with NextJS......but I encountered this error!
You should give directory address in the installation command ,
Try : npx create-next-app#latest . if you want to install the packages in current directory or
npx create-next-app#latest YOUR_FOLDER_NAME and packages will be installed in new folder with the given name as YOUR_FOLDER_NAME.
Try this:
npm i -g create-next-app
It will install create next app globally. To create a next app run this command, if you want to install in current folder.
npx create-next-app
Otherwise, specify the folder name like,
npx create-next-app [your app name]

Facing a problem when I am hitting npm run dev and npm run serve command

After install a fresh Vue cli project when I am hitting npm run serve command then it's showing this type on error
npm ERR! missing script: serve
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\NaimBiswas\AppData\Local\npm-cache\_logs\2021-01-08T17_12_07_143Z-debug.log
Can anybody help me to came out

Encounter error when installing react-router-dom

I get this error whenever I NPM install react-router-dom in vs code:
npm ERR! Unexpected end of JSON input while parsing near
'...stack-launcher":"^1.0'
npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\HP\AppData\Roaming\npm-cache_logs\2019-03-18T09_03_43_417Z-debug.log
Seems like you missed a comma after '...stack-launcher":"^1.0' in the package.json file.
If not delete the node_modules folder, delete package-lock.json file, run npm cache clean --force and try to re-install.

npm ERR! request to https://registry.npmjs.org/node-modules failed, reason: error:0906D06C:PEM routines:PEM_read_bio:no start line

I am getting this error while installing any JS package , I have done lots of search but no luck. So please let me know where i am making mistake.
npm ERR! request to https://registry.npmjs.org/node-modules failed,
reason: error:0906D06C:PEM routines:PEM_read_bio:no start line
WebServer : Apache2(xampp)
Node : v9.3.0
NPM : 5.5.1
I think that first you need to start prompt as an administrator, then run npm cache clean -f then try to run npm install, by this command the npm will install the packages listed in package.json.
Or
You can run npm config set registry http://registry.npmjs.org/ so you can run npm install -g node-modules. Read more in this answer.
I faced the same problem and finally I was able to solve the exact above error by doing the following steps:-
check version of your npm with npm -v
run npm -g install npm#<version> This step is important as npm is getting installed globally here.
Now run the command where you want to install something globally using npm. In my Case the command was npm install -g #angular/cli#6.2.9 which worked fine after these changes
If you are still facing the problem, I would recommend to follow the instructions about installing nodejs perfectly from here https://docs.npmjs.com/try-the-latest-stable-version-of-npm#upgrading-on-windows

I cant install Bower with npm 2.7.4

My env is Ubuntu 14.04 and I'm using node v0.12.2.. I have installed node via nvm tool..
When Bower is installing, the errors is getting..
npm install -g bower
npm ERR! registry error parsing json
npm ERR! registry error parsing json
npm ERR! registry error parsing json
npm ERR! registry error parsing json
npm ERR! registry error parsing json
I have waited long time to finish installing but it is never finished! I have tried do that many times, I was not able to install Bower..
My npm version is 2.7.4. How can I install bower? There is a different way of installing Bower?

Categories

Resources