why i use npm to install something, it will have this problem as below
ERROR: npm is known not to run on Node.js v9.2.1
Node.js 9 is supported but the specific version you're running has
a bug known to break npm. Please update to at least 9.0.0 to use this
version of npm. You can find the latest release of Node.js at https://nodejs.org/
Then i find some solutions at stackoverflow.
npm WARN npm npm does not support Node.js v9.1.0
npm does not support Node.js v9.0.0
Almost every answer suggest to use "npm uninstall -g npm" first.But when i use this command,it will have the same error as above.
My npm version is 6.13.7
My node version is 9.2.
Basically node js 9.2... version is compatible with npm version 5.5.1.
So I will provide you the following suggestion.
1- if you want to work with node js 9.2 only then
i)- uninstall node js 9.2
ii)- uninstall npm
iii)- install node js 9.2
iv)- then install npm version 5.5.1
npm install -g npm#5.5.1
2- update node js and npm to the latest version and check your code compatibility with the new version.
To do this
1- install node js latest version
2-npm install -g npm#latest
Related
I am working on a project in our organization. while i am trying to run or install libraries it's getting an error.
E:\GIT\bookshelf>npm install
npm WARN deprecated bcrypt-nodejs#0.0.3: bcrypt-nodejs is no longer actively maintained. Please use bcrypt or bcryptjs
npm WARN deprecated #angular/http#4.1.3: Package no longer supported. Use #angular/common instead
npm WARN deprecated formidable#1.1.1: Please upgrade to latest, formidable#v2 or formidable#v3!
npm WARN deprecated core-js#2.4.1: core-js#<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated angular-tree-component#3.2.3: Library moved to #circlon/angular-tree-component
npm WARN deprecated multer#1.2.0: Multer 1.x is affected by CVE-2022-24434. This is fixed in v1.4.4-lts.1 which drops support for versions of Node.js before 6. Please upgrade to at least Node.js 6 and version 1.4.4-lts.1 of Multer. If you need support for older versions of Node.js, we are open to accepting patches that would fix the CVE on the main 1.x release line, whilst maintaining compatibility with Node.js 0.10.
npm WARN deprecated angular2-infinite-scroll#0.3.4: Please use the new --> ngx-infinite-scroll <--- supports in Angular +4, AOT compilation and optimized code bundle
npm WARN deprecated log4js#2.3.12: 2.x is no longer supported. Please upgrade to 6.x or higher.
npm WARN deprecated ckeditor#4.5.9: We have renamed the #ckeditor package. New versions are available under the #ckeditor4 name.
npm WARN deprecated angular2-recaptcha#0.6.0: Package no longer supported.
npm WARN deprecated fingerprintjs2#1.5.1: Package has been renamed to #fingerprintjs/fingerprintjs. Install #fingerprintjs/fingerprintjs to get updates.
npm WARN deprecated querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated request#2.83.0: request has been deprecated
npm ERR! Windows_NT 10.0.19044
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.17.1
npm ERR! npm v3.10.10
npm ERR! Cannot convert undefined or null to object
npm ERR!
npm ERR! If you need help, you may report this error at:
npm WARN deprecated ng2-bootstrap#1.4.0: ng2-bootstrap is renamed to ngx-bootstrap, please do npm i ngx-bootstrap -S
npm WARN deprecated request-promise#4.2.2: request-promise has been deprecated because it extends the now deprecated request package,
npm ERR! Please include the following file with any support request:
npm ERR! E:\GIT\bookshelf\npm-debug.log
I am using node version: 6.17.1 ( setup via NVM )
npm version: 3.10.10
windows machine.
Anyone helps me to find out what am I missing?
first remove package-json.lock file then try this npm command:
npm install --no-audit
run the command on your terminal.
or you can read this How can I fix this npm error? npm ERR! Windows_NT 10.0.19042, similar problem.
Error: The module '\?\C:\Users\ncid1\OneDrive\Desktop\Boblox\node_modules\better-sqlite3\build\Release\better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 83. This version of Node.js requires
NODE_MODULE_VERSION 108. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
Try uninstalling the package (better-sqlite3)
npm uninstall better-sqlite3
And then reinstall it
npm install better-sqlite3
I am looking for a way to upgrade my npm, I follow the option 3 for windows in here npm docs. but when I install it it said npm.exe already in nodejs folder. I try to overwrite it with --force but it still not overwritten. How to do it correctly? also how to update node?
This is the new best way to upgrade npm on Windows.
Run PowerShell as Administrator
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
npm install -g npm-windows-upgrade
npm-windows-upgrade
Note: Do not run npm i -g npm. Instead, use npm-windows-upgrade to update npm going forward. Also if you run the NodeJS installer, it will replace the node version.
Upgrades npm in-place, where node installed it.
Easy updating, update to the latest by running npm-windows-upgrade -p -v latest.
Does not modify the default path.
Does not change the default global package location.
Allows easy upgrades and downgrades.
Officially recommended by the NPM team.
A list of versions matched between NPM and NODE (https://nodejs.org/en/download/releases/) - but you will need to download NODE INSTALLER and run that to update node (https://nodejs.org/en/)
There is a tool, nvm, that solves your problem quite easly. There is also a Windows version, is not as cool as the linux/mac version but it works fine anyway
I suggest using option 1. Go to environment system variables and add "%appdata%\npm" to path like this: edit path
Then updated npm files should be loaded before those you installed with node
Node.js v16 or higher?
npm install -g npm
Node.js v14 or below?
Consider updating to latest LTS release of Node.js
npm-windows-upgrade
I installed the latest node.js v13. After the installation, I ran npm -g upgrade and got the following warnings;
npm WARN npm npm does not support Node.js v13.0.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11, 12.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN npm npm does not support Node.js v13.0.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11, 12.
npm WARN npm You can find the latest version at https://nodejs.org/
How to clear the warnings? Any side effects if I ignore?
I am using Windows 10.
Nodejs version you have installed v13.0.0 doesn't support npm.
With new npm releases you will able to use node using npm.
You may need to downgrade node if you want to use npm.
There is an already issue reported on github. Please check link :
https://github.com/nodejs/node/issues/30066
I will answer my own question.
npm#6.12.1 has just been released. I have tested that running install -g npm on my PC will solve the problem.
Credit goes to the person who posted the comment in this link;
https://github.com/nodejs/node/issues/30066#issuecomment-547551833
I followed the documentation to create my first NestJS project.
Installing the Nest CLI with the command npm i -g #nestjs/cli was successful.
The output was:
+ #nestjs/cli#6.3.0
updated 1 package in 11.326s
However, when I try to scaffold a project with the Nest CLI:
nest new project-name
I get the following error:
zsh: command not found: nest
Some details about my environment:
OSX
iTerm
npm version 6.5.0
Use npx #nestjs/cli instead of nest
e.g. npx #nestjs/cli g controller pages
I was also getting the same console error when npm installing!
Erro was
#nestjs/cli
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/#nestjs/cli
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/#nestjs
npm WARN notsup Unsupported engine for watchpack-chokidar2#2.0.0: wanted: {"node":"<8.10.0"} (current: {"node":"12.14.1","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: watchpack-chokidar2#2.0.0
How I wasn able to install =>
Solution
sudo npm install -g #nestjs/cli
Following command works in my windows 10
node -v
v14.16.0
npm -v
6.14.11
npx #nestjs/cli new project-name
I was having the same issue, what I did was:
Installed the latest node with npm install npm#latest -g
and then added the following to my .bash_profile
alias nest="/usr/local/Cellar/node/11.9.0/bin/nest"
Tested with nest --version and it worked.
For some reason the path is not being called correctly, hope it helps.
Working through a NestJS/Mongo DB tutorial i stumbled into this very same problem. After trying all of the solutions that were listed above, even turning my default profile back to bash instead of using zsh, i found that simply adding the /usr/local/bin and ~/.npm-global/bin to my path variable resolved the issue. Hopefully this helps someone else who may stumble on this in the future as well.
export $PATH="/usr/local/bin"
export $PATH="~/.npm-global/bin"
Were the two commands i ran from iTerm2 in order to add them to my PATH environment variable. Once this was done a simple
env
showed the entries in my $PATH environment variable and the nest -v command worked without any issues.
I had same error when I use GitBash.
I resoved it:
If you use windows:
Your use CMD: npm i -g #nestjs/cli
Then you can use gitbash:
Check version nestjs: nest --version
Create app nestjs: nest new name_project
I have faced same problem and solved ,following this
write the command NPM root -g
check where NPM is installed
add it to your path environment variable
You have to add the following line to your ~/.zshrc file:
source $HOME/.bashrc
This is needed so that the npm binaries are available on startup.
After all the answers that I tried, I used my method
After installing npm i -g #nestjs/cli in my mac terminal.
open bash file in macos by typing open ~/.bash_profile in mac terminal. Like you can type it anywhere.
Your bash will look like this and use this line
alias nest="~/.npm-global/lib/node_modules/#nestjs/cli/bin/nest.js"
Restart your mac for changes to be reflected in your terminal.
There you go nestjs cli is now working globally 2nd screenshot.
I have just succeeded with
npx #nets/cli new project
when asked what manager to choose from npm / yarn / pnpm
made choice for pnpm
cd project
npm run start
Take care!
Must use sudo in comandline for linux, otherwise the command nest cannot be add to /usr/local/bin folder:
sudo npm install -g #nestjs/cli
You can try to use sudo
sudo yarn global add #nestjs/cli
I got the same issue.
I just uninstalled and reinstalled nextjs.
Finally, I can use next -v