1

After installing Node.js on Windows 7 from an admin account and verifying it runs, I attempted to install a webserver.

C:\nodejs> npm install connect

I get the following npm-debug log:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\nodejs\\\\node.exe',
1 verbose cli   'C:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'connect' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink C:\nodejs\\node.exe
5 error Error: ENOENT, stat 'C:\Users\One\AppData\Roaming\npm'
6 error If you need help, you may report this *entire* log,
6 error including the npm and node versions, at:
6 error     <http://github.com/npm/npm/issues>
7 error System Windows_NT 6.1.7601
8 error command "C:\\nodejs\\\\node.exe" "C:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "connect"
9 error cwd C:\nodejs
10 error node -v v0.10.31
11 error npm -v 1.4.23
12 error path C:\Users\One\AppData\Roaming\npm
13 error code ENOENT
14 error errno 34
15 verbose exit [ 34, true ]
1
  • I tested the install with the following inside the nodejs prompt: function testNode() {return "Node is working"}; testNode(); I get the following: 'Node is Working' So it appears the install is basically fine I think. Commented Sep 12, 2014 at 21:38

4 Answers 4

1

You didn't install node properly: you installed it "as admin" so it installed it for the admin account, not for you. Now you're running it as user "One" and it's trying to find your profile's npm dir, which was never made, because "you" didn't install it.

So: grab the .msi installer from nodejs.org again, run it as yourself, and when the install process asks for permission with a UAC popup, then grant the permission with the admin password.

(This is a general thing: don't install things "as admin", install things as yourself, and when UAC requires admin permission, give those. Otherwise you're installing things as the wrong user)

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. I didn't notice I was doing this. I'm accustomed to installing desktop applications from my admin account then using standard account to work with them.
0

Manually creating a folder named 'npm' in the displayed path fixed the problem.

or or

I ran into the same problem while installing a package via npm and after creating the npm folder manually in C:\Users\UserName\AppData\Roaming\ that particular error was gone but it gave similar multiple errors as it tried to create additional directories in npm folder and failed. Issue was resolved after running the command prompt as administrator.

Comments

0

It worked for me when I did the following.

  1. Open nodejs command prompt as administrator.
  2. Change the directory to Node.js installation directory. For example in my computer the Node.js directory is located at C:\Program Files\nodejs
  3. Run this command: npm install connect

Comments

0

You can just change the security permissions and allow permission to the user by going like this NodeJs>properties>security>edit>allow to desired user, no need to re-install as user.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.