npm audit fix throwing errors - npm

npm audit fix --force
is not working for me. I'm getting the following error. I have updated npm to the latest but the result is same.
npm WARN audit Updating electron to 6.1.12, which is a SemVer major change.
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 1
npm ERR! path /Users/a1/Desktop/Coding/pinpadtrial/node_modules/electron
npm ERR! command failed
npm ERR! command sh -c /var/folders/d_/4kw46v7n4fj05lh26rt915400000gn/T/postinstall-1656028299602.sh
Downloading tmp-17971-0-electron-v6.1.12-darwin-arm64.zip
npm ERR! Error: GET https://github.com/electron/electron/releases/download/v6.1.12/electron-v6.1.12-darwin-arm64.zip returned 404
npm ERR! /Users/a1/Desktop/Coding/pinpadtrial/node_modules/electron/install.js:53
npm ERR! throw err
npm ERR! ^
npm ERR!
npm ERR! Error: Failed to find Electron v6.1.12 for darwin-arm64 at https://github.com/electron/electron/releases/download/v6.1.12/electron-v6.1.12-darwin-arm64.zip
npm ERR! at Request.<anonymous> (/Users/a1/Desktop/Coding/pinpadtrial/node_modules/nugget/index.js:169:61)
npm ERR! at Request.emit (node:events:394:28)
npm ERR! at Request.onRequestResponse (/Users/a1/Desktop/Coding/pinpadtrial/node_modules/request/request.js:1059:10)
npm ERR! at ClientRequest.emit (node:events:394:28)
npm ERR! at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:621:27)
npm ERR! at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
npm ERR! at TLSSocket.socketOnData (node:_http_client:487:22)
npm ERR! at TLSSocket.emit (node:events:394:28)
npm ERR! at addChunk (node:internal/streams/readable:312:12)
npm ERR! at readableAddChunk (node:internal/streams/readable:287:9)
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/a1/.npm/_logs/2022-06-23T23_51_37_371Z-debug-0.log```

Related

npm install --global windows-build-tools problem

npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated windows-build-tools#4.0.0: Node.js now includes build tools for Windows. You probably no longer need this tool. See https://github.com/felixrieseberg/windows-build-tools for details.
npm ERR! code 1
npm ERR! path C:\Users\ABC\AppData\Roaming\npm\node_modules\windows-build-tools
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node ./dist/index.js
Downloading python-2.7.14.amd64.msi
npm ERR! [============================================>] 100.0% of 20.2 MB (3.51 MB/s)
npm ERR! Downloaded python-2.7.14.amd64.msi. Saved to C:\Users\ABC\.windows-build-tools\python-2.7.14.amd64.msi.
Downloading BuildTools_Full.exe
npm ERR! [============================================>] 100.0% of 3.29 MB (3.29 MB/s)
npm ERR! Downloaded BuildTools_Full.exe. Saved to C:\Users\ABC\.windows-build-tools\BuildTools_Full.exe.
npm ERR!
npm ERR! Starting installation...
npm ERR! Downloading installers failed. Error: TypeError: 'process.env' only accepts a configurable, writable, and enumerable data descriptor
npm ERR! at Function.defineProperty (<anonymous>)
npm ERR! at Object.removePath (C:\Users\ABC\AppData\Roaming\npm\node_modules\windows-build-tools\dist\utils\remove-path.js:11:12)
npm ERR! at Object.install (C:\Users\ABC\AppData\Roaming\npm\node_modules\windows-build-tools\dist\install\index.js:29:19)
npm ERR! at C:\Users\ABC\AppData\Roaming\npm\node_modules\windows-build-tools\dist\start.js:17:19
npm ERR! at Object.download (C:\Users\ABC\AppData\Roaming\npm\node_modules\windows-build-tools\dist\download.js:35:5)
npm ERR! at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
npm ERR! at async Object.aquireInstallers (C:\Users\ABC\AppData\Roaming\npm\node_modules\windows-build-tools\dist\aquire-installers.js:32:13) {
npm ERR! code: 'ERR_INVALID_OBJECT_DEFINE_PROPERTY'
npm ERR! }
npm ERR! windows-build-tools will now exit.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ABC\AppData\Local\npm-cache\_logs\2023-01-18T06_00_13_950Z-debug-0.log
how to solve it please

installing package locally gives an error

When i am trying to install package i'm getting this error. In addition all other packages were installed without any problems. How could i solve this. If i'm changing flag to -g (globally) it works, but i need it to be in my project
npm install --save express-validator
npm http GET https://registry.npmjs.org/express-validator
npm http 304 https://registry.npmjs.org/express-validator
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/validator
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/validator
npm http GET https://registry.npmjs.org/types/bluebird
npm http GET https://registry.npmjs.org/types/express
npm http 404 https://registry.npmjs.org/types/bluebird
npm ERR! TypeError: Cannot read property 'latest' of undefined
npm ERR! at next (/usr/share/npm/lib/cache.js:687:35)
npm ERR! at /usr/share/npm/lib/cache.js:675:5
npm ERR! at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR! at /usr/lib/nodejs/graceful-fs/polyfills.js:133:7
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Linux 3.19.0-30-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "express-validator"
npm ERR! cwd /home/prog/work/appJS
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! type non_object_property_load
npm http 404 https://registry.npmjs.org/types/express
npm ERR! TypeError: Cannot read property 'latest' of undefined
npm ERR! at next (/usr/share/npm/lib/cache.js:687:35)
npm ERR! at /usr/share/npm/lib/cache.js:675:5
npm ERR! at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR! at /usr/lib/nodejs/graceful-fs/polyfills.js:133:7
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Linux 3.19.0-30-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "express-validator"
npm ERR! cwd /home/prog/work/appJS
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! type non_object_property_load
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/prog/work/appJS/npm-debug.log
npm ERR! not ok code 0
This occurs when ur npm version is down or the library has been removed.
you need to update your npm version...!!
npm update npm#latest

npm publish to Artifactory not working

I have setup Artifactory according to the instructions given here, http://www.jfrog.com/confluence/display/RTF/Npm+Repositories, but on publishing a package the following is displayed:
npm http PUT http://localhost:8083/artifactory/api/npm/npm-local/UIBase
npm http 400 http://localhost:8083/artifactory/api/npm/npm-local/UIBase
npm ERR! registry error parsing json
npm ERR! publish Failed PUT response 400
npm ERR! SyntaxError: Unexpected token M
npm ERR! Missing attachments with tarball data, aborting upload for: 'UIBase'
npm ERR! at Object.parse (native)
npm ERR! at RegClient.<anonymous> (/usr/share/npm/node_modules/npm-registry-client/lib/request.js:238:23)
npm ERR! at Request.self.callback (/usr/lib/nodejs/request/index.js:148:22)
npm ERR! at Request.EventEmitter.emit (events.js:98:17)
npm ERR! at Request.<anonymous> (/usr/lib/nodejs/request/index.js:896:14)
npm ERR! at Request.EventEmitter.emit (events.js:117:20)
npm ERR! at IncomingMessage.<anonymous> (/usr/lib/nodejs/request/index.js:847:12)
npm ERR! at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR! at _stream_readable.js:920:16
npm ERR! at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Linux 3.13.0-39-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "publish" "--registry" "http://localhost:8083/artifactory/api/npm/npm-local"
npm ERR! cwd /home/debjit/code/pubmatic/pub-mgmt/ui/UIBase
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! type unexpected_token
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/debjit/code/pubmatic/pub-mgmt/ui/UIBase/npm-debug.log
npm ERR! not ok code 0
The command I have used is:
npm publish --registry http://localhost:8083/artifactory/api/npm/npm-local
Artifactory logs show the following:
2014-11-19 23:15:23,541 [http-bio-8083-exec-2] [WARN ] (o.j.r.n.r.h.NpmLocalRepoHandler:192) - Missing attachments with tarball data, aborting upload for: 'UIBase'
What am I missing?
You should upgrade your npm client and use at least 1.4.3.
The reason is that the publish command has changed and Artifactory supports the newer format.

NPM installation error

I tried installing browserify (npm module).. I got following error-
praful#ubuntu:~/terminalcloud$ npm install -g browserify
npm http GET https://registry.npmjs.org/browserify
npm ERR! Error: failed to fetch from registry: browserify
npm ERR! at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR! at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR! at Request._callback (/usr/share/npm/lib/utils/npm-registry-client /request.js:136:18)
npm ERR! at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR! at Request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58)
npm ERR! at Request.emit (events.js:88:20)
npm ERR! at ClientRequest.<anonymous> (/usr/lib/nodejs/request/main.js:412:12)
npm ERR! at ClientRequest.emit (events.js:67:17)
npm ERR! at HTTPParser.onIncoming (http.js:1261:11)
npm ERR! at HTTPParser.onHeadersComplete (http.js:102:31)
npm ERR! You may report this log at:
npm ERR! <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR! reportbug --attach /home/praful/terminalcloud/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.8.0-29-generic
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "browserify"
npm ERR! cwd /home/praful/terminalcloud
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: browserify
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/praful/terminalcloud/npm-debug.log
npm not ok
I have installed npm package properly. This error occurs for any package that I try installing with npm. What should I do to?
Just wondering, have you tried
npm config set registry http://registry.npmjs.org/
as per this
The probleme comes from the registry you are using, it is using a secure connection with the hyper transfert text protocol, that might screw things up. https://registry.npmjs.org/browserify
you should use a simple registry that is easy fetchable :
sudo npm config set registry http://registry.npmjs.org/

Error: No compatible version found: package-json#'^6.3.0'

I want to install latest version of NPM and running this
npm install latest-version
I receive
No compatible version found:package-json'^6.3.0
npm WARN package.json copy-descriptor#0.1.1 No readme data.
npm WARN package.json get-value#2.0.6 No readme data.
npm WARN package.json object-copy#0.1.0 No readme data.
npm WARN package.json static-extend#0.1.2 No readme data.
npm http GET https://registry.npmjs.org/latest-version
npm http 200 https://registry.npmjs.org/latest-version
npm http GET https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz
npm http 200 https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz
npm http GET https://registry.npmjs.org/package-json
npm http 200 https://registry.npmjs.org/package-json
npm ERR! Error: No compatible version found: package-json#'^6.3.0'
npm ERR! Valid install targets:
npm ERR! ["0.1.0","0.2.0","1.0.0","1.0.1","1.0.2","1.1.0","1.2.0","2.0.0","2.0.1","2.1.0","2.2.0","2.2.1","2.3.0","2.3.1","2.3.2","2.3.3","2.4.0","3.0.0","3.1.0","4.0.0","4.0.1","5.0.0","6.0.0","6.1.0","6.2.0","6.3.0","6.4.0","6.5.0"]
npm ERR! at installTargetsError (C:\Program Files\nodejs\node_modules\npm\lib\cache.js:709:10)
npm ERR! at C:\Program Files\nodejs\node_modules\npm\lib\cache.js:631:10
npm ERR! at saved (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\get.js:138:7)
npm ERR! at FSReqCallback.oncomplete (fs.js:146:23)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Windows_NT 10.0.18362
npm ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "latest-version"
npm ERR! cwd C:\Users\smuminov
npm ERR! node -v v12.13.0
npm ERR! npm -v 1.2.24
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\smuminov\npm-debug.log
npm ERR! not ok code 0
how to resolve this issue?
Current npm version - 1.2.24
Current node version - v12.13.0
You are using a very old version of npm.
Use the following command to update npm:
npm install npm#latest