npm can not publish my module
Asked Answered
A

2

6

I am trying to publish my module to see how it works.

I installed npm and then created my very simple module.

I used npm add user to add myself as a new user. I received the following message: Logged in as david1994 on https://registry.npmjs.org/

Then I tried to publish my module with npm publish, but I got the following error:

npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\supermodule\\npm-debug.log.1866747129' }

But I can not see any npm-debug.log in my module directory.

Aster answered 10/9, 2016 at 18:16 Comment(7)
1) Might it be a hidden file? 2) Are you able to access the file?Doghouse
can you install packages from npm registry?Caught
@Venky, I installed npm.Aster
@Scimonster, I checked the file but there is not log file in my directory. I opened hidden files and folders. Still no result. I can add user, because after I add I can login in npm.org but I can not do "npm publish"Aster
What does your package.json look like?Noise
Here is my package.json file: { "name": "supermodule", "version": "0.0.1", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "description": "" }Aster
Read this. Hope helpful github.com/npm/npm/issues/8561Selfcontrol
S
5

Possible it looks like a module with that name was already published by someone else, so you'd need to use a different name, or use a scope if you really want to keep the same name.

could you check that the name is not already taken by someone else, as well?

read more

Selfcontrol answered 16/10, 2017 at 8:46 Comment(0)
E
0

The EPERM error indicates that there is a problem opening a file as the npm publish command does not seem to have permission to access to that file.

The name of the file giving you the problem should be found in the report file ...

debug.log.1866747129

in the following directory ...

C:\Program Files\nodejs\node_modules\npm\node_modules\supermodule\

If for some reason you cannot access the above file run the publish step again using --dd flag which will increase the amount of logging that you see on the screen should help you troubleshoot your problem

See npm config for a full list of command line parameters that can help you troubleshoot this problem.

Emoryemote answered 11/9, 2016 at 13:58 Comment(2)
Unfortunately, I can not find any log file in the directory you mentioned. Now trying to publish I have the following: npm ERR! you do not have permission as the correct user? : supermoduleAster
Have you tried running cmd or powershell as Administrator; Right Click then select Run As Administrator.Emoryemote

© 2022 - 2024 — McMap. All rights reserved.