npm ERR! npm owner add <user> - npm-install

Could someone tell why I'm getting these errors?
npm au build --env prod
npm ERR! Usage:
npm ERR! npm owner add <user> [<#scope>/]<pkg>
npm ERR! npm owner rm <user> [<#scope>/]<pkg>
npm ERR! npm owner ls [<#scope>/]<pkg>
npm ERR!
npm ERR! alias: author
Thanks, KB

Because you used npm au which is short for npm author.
$ npm author --help
npm owner add <user> [<#scope>/]<pkg>
npm owner rm <user> [<#scope>/]<pkg>
npm owner ls [<#scope>/]<pkg>
You probably ment to use npm run build --env prod.

Related

npm install -g #sanity/cli commend is not working

I tried to run npm install -g #sanity/cli commend to use Sanity but my return is this..
npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/#sanity/cli/bin/sanity
npm ERR! dest /usr/local/bin/sanity
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/#sanity/cli/bin/sanity' -> '/usr/local/bin/sanity'
npm ERR! [Error: EACCES: permission denied, symlink '../lib/node_modules/#sanity/cli/bin/sanity' -> '/usr/local/bin/sanity'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/#sanity/cli/bin/sanity',
npm ERR! dest: '/usr/local/bin/sanity'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/kevinsong/.npm/_logs/2022-07-27T17_49_06_969Z-debug-0.log
npm -v 8.13.2
What need to be done to run the npm install -g #sanity/cli?
when I do vi /usr/local/bin, I see this
node*
corepack# --> /usr/local/lib/node_modules/corepack/dist/corepack.js
npm# --> /usr/local/lib/node_modules/npm/bin/npm-cli.js
npx# --> /usr/local/lib/node_modules/npm/bin/npx-cli.js
~
It's because your current user doesn't have the permission
you can check the permission
ls -la /usr/local/lib/node_modules
get the permission for sudo access
sudo chown -R $USER /usr/local/lib/node_modules/
Now try with
sudo npm install -g #sanity/cli
Click HERE for more

VS code setting up development tools ERR! permission

I'm new to using VS code, I'm trying to install Hubspot tools using the npm install -g #hubspot/cli
But when i do i get the following
Thorins-MBP:Practice project thorinphoenix$ npm install -g #hubspot/cli
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/#hubspot
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/#hubspot'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/#hubspot'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/#hubspot'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/thorinphoenix/.npm/_logs/2022-05-18T13_17_18_580Z-debug-0.log
Thorins-MBP:Practice project thorinphoenix$
I used the best fix on this page and it worked. How to fix EACCES issues with npm install
Enter this into terminal:
sudo chown -R `whoami` ~/.npm
sudo chown -R `whoami` /usr/local/lib/node_modules

npm install code 1 error git dep preparation failed

Has anyone hit the error below when trying to install NPM?
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /home/user1/.nvm/versions/node/v15.12.0/bin/node /home/user1/.nvm/versions/node/v15.12.0/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/home/user1/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code 1
npm ERR! npm ERR! The git reference could not be found
npm ERR! npm ERR! command git --no-replace-objects checkout 4.0
npm ERR! npm ERR! error: pathspec '4.0' did not match any file(s) known to git
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR! /home/user1/.npm/_logs/2021-07-27T07_22_59_809Z-debug.log
npm ERR! A complete log of this run can be found in:
npm ERR! /home/user1/.npm/_logs/2021-07-27T07_24_31_341Z-debug.log
In my case I got that error while using node v16.13.0. After I switched to v10.24.1, it got solved.
I'm on In Windows 10 with node 16.
For me, the solution was either running commands
set NODE_ENV=development
$env:NODE_ENV="development"
or calling the npm install command with admin rights inside PowerShell
By the way, when I switched to node v12, it worked for me as well.

Installing public package using `npm i curlconverter` results in `fatal: Could not read from remote repository`

There already is an issue about this on github however the proposed solution does not solve the problem. I am also not knowledgeable enough to know if this is a bug in the library or not.
$ npm i curlconverter
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git#github.com/NickCarneiro/yargs-ansi.git
npm ERR!
npm ERR! git#github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128
npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2021-05-17T14_07_32_675Z-debug.log
I am able to install curlconverter locally by installing an older version:
npm install --save yargs
npm install --save curlconverter#3.12.0
However if I do this in a Dockerfile it still errors:
Step 6/9 : RUN npm install --save curlconverter#3.12.0
---> Running in 2f5e6c7af7ce
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git#github.com/NickCarneiro/yargs.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-05-17T14_06_02_821Z-debug.log
The command '/bin/sh -c npm install --save curlconverter#3.12.0' returned a non-zero code: 1
What is the problem here and is there any way to install and use the package?

NPM local install tried to write ~/.npm folder which got EACCESS error

I tried to add the 'method-override' package to my current Express project. I ran below command, and got error.
qinguo$ npm install method-override --save
npm WARN package.json redis-url#0.2.0 No repository field.
npm ERR! Error: EACCES, mkdir '/Users/qinguo/.npm/parseurl/1.1.3'
npm ERR! { [Error: EACCES, mkdir '/Users/qinguo/.npm/parseurl/1.1.3']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/qinguo/.npm/parseurl/1.1.3',
npm ERR! parent: 'method-override' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "method-override" "--save"
npm ERR! cwd /Users/qinguo/allcodes/gitebay/NewX/sh-go
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.5.0-alpha-3
npm ERR! path /Users/qinguo/.npm/parseurl/1.1.3
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/Users/qinguo/.npm/parseurl/1.1.3'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/qinguo/allcodes/gitebay/NewX/sh-go/npm-debug.log
npm ERR! not ok code 0
I tried to update npm, re-install, it didn't work.
Try running as sudo -
npm install method-override --save
My guess is that root owns some of the packages in npm's cache. You can check by running:
ls -l ~/.npm
Check if the package causing the error is not owned by your user.
If some of the packages are owned by root, you should chown the ~/.npm folder to your current user.
sudo chown -R `whoami` ~/.npm
Read more: npm cache