errors when doing an nw install with latest node.js - node.js

I have been using nw for a number of years. I recently updated node.js to 19.3.0 and am wanting to update nw in my projects. When I do the following:
npm install nw#0.72.0-sdk
I get a number of deprecate messages and then a 404 error. After starting the command I do see the nodemodules folder being created, but it is later deleted. The first error appearing is this:
3602 verbose stack Error: command failed
3602 verbose stack at ChildProcess. (/Users/csrf/.nvm/versions/node/v19.3.0/lib/node_modules/npm/node_modules/#npmcli/promise-spawn/lib/index.js:53:27)
I am wondering whether I need to revert to an earlier version of node.js and nw?

Cannot reproduce. I changed my Node version to 19.3.0. Made an empty folder and ran this in it:
echo > index.html && npm init -y && npm pkg set devDependencies.nw="0.72.0-sdk" && npm pkg set main="index.html" && npm pkg set scripts.start="nw ." && npm install && npm start
Worked without any issues. Other than the usual audit notice:
added 119 packages, and audited 120 packages in 1m
8 packages are looking for funding
run `npm fund` for details
4 vulnerabilities (2 moderate, 2 high)
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
I'm assuming you just had a bad internet connect, or the server that hosts the NW.js binaries was being flaky (I've seen reports of this before). Just delete the node_modules and try again.

This command has enabled the installation of nw:
npm_config_nwjs_process_arch=x64 npm install nw#0.72.0-sdk --verbose
Came from this issue report:
https://github.com/nwjs/npm-installer/issues/83

Related

Issue while installing Angular CLI on windows 11 with node version 18.12.1

I was trying to install angular cli and i had these two warning i'm afraid that will bother me later i don't know how to fix it help me please.....
C:\Users\ASUS>npm install -g #angular/cli
npm WARN deprecated #npmcli/move-file#2.0.1: This functionality has been moved to #npmcli/fs
npm WARN deprecated sourcemap-codec#1.4.8: Please use #jridgewell/sourcemap-codec instead
changed 231 packages, and audited 232 packages in 5s
26 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
After I tried to see the version of angular if it is installed. The cmd displayed this error.
C:\Users\ASUS>ng --version
Error: You need to specify a command before moving on. Use '--help' to view the available commands.
Try the command ng v and check if it ask any question about google and say N as no. If it shows angular versions then it means angular/cli is installed
i have install it with Yarn
1.install Yarn
https://classic.yarnpkg.com/lang/en/docs/install/#windows-stable
in my case i choosed msi download because it failled with npm
With Yarn installed Angular / cli
yarn add #angular/cli
in environment variable I add the path this ng root
INSTALLATION_PATH\node_modules.bin
and now i have it globall.

When I install Axios an audit error occurs

This is the error I get when running the command npm i axios:
up to date, audited 1469 packages in 6s
226 packages are looking for funding
run `npm fund` for details
6 high severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
Here, I use VS code and typed that command on its terminal.
I keep getting this error when trying to install axios, and I am not sure how to fix this.
Could this be a problem for my future coding?
This is a result of the new npm version including the audit command.
It isn't some new issue with the CLI, npm just introduced new functionality in npm to warn users about vulnerabilities in the packages they're installing - so there's no "new" vulnerability, it's just that now npm is now warning you about vulnerabilities that already existed: https://blog.npmjs.org/
If you have run npm audit and got vulnerabilities, then you can have different scenarios:
Security vulnerabilities found with suggested updates
Run the npm audit fix subcommand to automatically install compatible updates to vulnerable dependencies.
Run the recommended commands individually to install updates to vulnerable dependencies. (Some updates may be semver-breaking changes; for more information, see "SEMVER warnings".)
Security vulnerabilities found requiring manual review
If security vulnerabilities are found, but no patches are available, the audit report will provide information about the vulnerability so you can investigate further.
You can read more about it here.
Even after running npm audit fix if it is not fixed, then you can Turn off npm audit. Use the below command to turn off the npm audit.
When installing a single package:
npm install example-package-name --no-audit
To turn off npm audit when installing all packages:
npm set audit false
It will set the audit setting to false in your user and global npmrc config files.
If you still want to fix them, you can refer to this article about how to.

I am getting npm fund warnings when I am trying to install Angular packages:

I am getting npm warnings when I am trying to install packages:
changed 280 packages, and audited 280 packages in 2m
31 packages are looking for funding
run npm fund for details
found 0 vulnerabilities
After this warning I have given command npm fund then I got My system name. I didn't understand.
Please anyone helpme how to solve this issue and how to complete Angular cli installation.
npm fund listes all dependencies to which its owners are seeking funds (or moneys) to maintain the development of that dependency. When you execute npm fund without arguments, then all installed dependencies on your project (That is direct dependencies and dependencies dependencies) which are looking for funds will be listed.
More info on: https://docs.npmjs.com/cli/v6/commands/npm-fund
You can get rid of the npm fund warnings permanently with the npm config set fund false command. It sets the funds flag in your .npmrc file to funds=false
a sample screenshot

npm audit fix not changing anything

I think this is a pretty basic question but i've been stuck for a while:
I am trying to use npm audit fix to clean up an old repo that has many security vulnerabilities. When I run, I see that I get the following output:
fixed 3534 of 3576 vulnerabilities in 1926 scanned packages
42 vulnerabilities required manual review and could not be updated
However, I see that nothing in package-lock.json was changed. So It doesn't appear that audit has actually done anything? When I run npm install I can again see the following:
found 3576 vulnerabilities (3550 low, 10 moderate, 14 high, 2 critical)
run `npm audit fix` to fix them, or `npm audit` for details
Does this mean that the audit process was not able to resolve any of these issues? If so, how do I approach resolving these?
What causes it: This would seem to be a known bug in npm for which no one has (yet) publicly worked out the cause, at least not that I can find. However you can see it reported in an issue in the current npm issue tracker which links to an issue in the archived npm issue tracker.
How to fix: When I encounter this behavior in npm, I do this:
$ rm -rf node_modules package-lock.json shrinkwrap.json npm-shrinkwrap.json
$ npm install
However, I don't think that works all the time. But if you haven't done that, it's worth a shot. #Kshewengger's suggestion to update npm is a good thing to try too. They suggest npm install -g npm and try that first, but if that doesn't work and if you don't mind an updated package-lock.json file format and other changes, you can also try npm install -g npm#7. As of this writing, npm install -g npm will give you npm#6.14.9 and npm install -g npm#7 will give you npm#7.0.15.

`HMRClient` does not exist in the Haste module map - project fail to run after `npm install`

I have used node 8.x and I upgraded to new node 12.13.0 using brew.
I tried to run project after this and it was working fine.
Then I did npm install ofSomePackage and I got message like:
added 55 packages from 59 contributors, removed 536 packages, moved 16 packages and audited 905939 packages in 46.187s
found 13236 vulnerabilities (44 low, 8 moderate, 13183 high, 1 critical)
run `npm audit fix` to fix them, or `npm audit` for details
npm audit ask to use npm install I did nothing changed.
When I tried to run project I get that some packages are missing so I install missing packages again.
But I stuck on this:
Loading dependency graph, done.
error: bundling failed: Error: Unable to resolve module `metro/src/lib/bundle-modules/HMRClient` from `/Users/me/.../node_modules/react-native/Libraries/Utilities/HMRClient.js`: Module `metro/src/lib/bundle-modules/HMRClient` does not exist in the Haste module map
I checked and that file exist.
Please help.
I'd try resetting the packager server's cache. Sometimes it gets out of kilter with what's on the fs and if lucky that'll fix it.
With the react native cli (I'd guess expo based dev has something similar) restart server with
react-native start --reset-cache

Resources