NPM broken and reporting this error: npm ERR! 404 - javascript

I am running npm update -g and I get
npm ERR! code E404
npm ERR! 404 Not found : default-html-example
npm ERR! 404
npm ERR! 404 'default-html-example' is not in the npm 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! /Users/me/.npm/_logs/2018-10-25T22_24_12_353Z-debug.log
So, I get this after any command now, for example in any project, when I run ./node_modules/.bin/eslin . I get the linter results, but at the end of the verbose there is always this error.
--- UPDATE ---
Upon further investigation, I have found this.
Something called /usr/local/lib/node_modules/default-html-example
This is something I have worked on as an example as part of one of my first tutorials. Not sure about how on earth it ended up there.
When I checked it, it turns out it is a symlink to a tutorial: default-html-example -> /Users/me/learning/lynda_com_JavaScript_Essential_Training/MY_Ex_Files_JavaScript_EssT/Exercise_Files/default
This is still a mystery, how it ended up there?

Finding and removing that rogue folder /usr/local/lib/node_modules/default-html-example solved the issue.
However, I am still not sure how that folder ended up in that location. It was one of my first tutorial project folders.

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]

when trying npm install -D live-sever errors occur javascript

I always face troubles when i do npm install in my system. this time I am following javascript tutorial so he shows us to use the command npm install -D live-sever and it occurs errors. by the way im using internet behind proxy.
`npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/live-sever - Not found
npm ERR! 404
npm ERR! 404 'live-sever#*' 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.
The correct name is live-server:
npm install -D live-server

npm install error: Integrity Check failed

I have a github repo from where I pull the code and done npm install and that results in the error like,
npm ERR! code EINTEGRITY
npm ERR! Verification failed while extracting #my-package#^1.2.0:
npm ERR! Verification failed while extracting #my-package#^1.2.0:
npm ERR! Integrity check failed:
npm ERR! Wanted: sha512-lQ...HA==
npm ERR! Found: sha512-nH...ow==
Even though I referred multiple similar solutions like this, they are mentioning that we need to delete package-lock.json file but my lead has asked me not to delete lock file and it needs to be same for all the machines.
How can I get rid of this error without deleting package-lock.json file?
Deleting node_modules and doing npm i doesn't do any trick
and the above mentioned error still persists..

npx create-react-app my-app ERORR: rollbackFailedOptional

The command create-react-app my-app worked fine for the last week that I have been using it and now it is returning the error "rollbackFailedOptional: verb npm-session 895a42364389108b".
I already tried
npm config rm proxy
npm config rm https-proxy
npm config set registry http://registry.npmjs.org/
I am still getting the same error.
Edit:
after letting it fail completely it says the following:
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to http://registry.npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND domain
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\caleb\AppData\Roaming\npm-cache\_logs\2020-06-05T19_30_34_621Z-debug.log
I figured it out. I did
npm config get proxy
it returned null
So I had to go to "C:\Users\Myname.npmrc", open it in a notepad and then delete whats in there and add
proxy=http://yourorganizationproxy.com:8080
https-proxy=http://yourorganizationproxy.com:8080
As Caleb indicates you should go to "C:\Users\<user>" and check for .npmrc file, then edit with any notepad app. Then you should
Delete everything
Add:
proxy=http://yourorganizationproxy.com:8080
https-proxy=http://yourorganizationproxy.com:8080
strict-ssl=false
Save
Hope it helps

cannot find serevr.js in "Pro Javascript for Web Dev" book

Can anyone help me find and run the server.js file in the "download" files of the book "Pro Javascript for Web Dev" by Adam Freeman? In Page 8 it explains it as:
I rely on some third-party modules, so run the following command after
you have installed the
Node.js package:
npm install node-static jqtpl
This command downloads and installs the node-static and jqtpl packages
that I use to deliver static and templated content in the examples.
The command will generate output similar to this (but you may see some
additional warnings, which can be ignored):
npm http GET https://registry.npmjs.org/node-static
npm http GET https://registry.npmjs.org/jqtpl
npm http 200 https://registry.npmjs.org/jqtpl
npm http 200 https://registry.npmjs.org/node-static
node-static#0.5.9 ./node_modules/node-static
jqtpl#1.0.9 ./node_modules/jqtpl
However I don't get these messages and my examples do not run with right content. Instead I get these:
npm ERR! Linux 3.16.0-70-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "node-static" "jqptl"
npm ERR! node v4.4.3
npm ERR! npm v2.15.1
npm ERR! code E404
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/jqptl
npm ERR! 404
npm ERR! 404 'jqptl' is not in the npm 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! Please include the following file with any support request:
npm ERR! /home/nesa/www/pro-javascript/npm-debug.log
Can anyone help me? The link to the download of the files is:
http://www.apress.com/downloadable/download/sample/sample_id/1297/
Type jqtpl correctly, you are typing jqptl instead. Check you error log to see that

Categories

Resources