isaacs/npm — Issue #1892: AppData not found
Author: chowey
Created: 2011-12-16 16:47:11+00:00
State: open

So I updated to the latest version of npm (1.1.0-beta-5) using

npm install npm@alpha -g

Now I try to use npm and I get the following debug log:

info it worked if it ends with ok
verbose cli [ 'node',
verbose cli 'C:\\Users\\cam\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
verbose cli 'install',
verbose cli 'express',
verbose cli '--verbose' ]
info using npm@1.1.0-beta-5
info using node@v0.6.5
verbose config file C:\Users\cam\.npmrc
verbose config file C:\Program Files\nodejs\etc\npmrc
verbose config file C:\Users\cam\AppData\Roaming\npm\node_modules\npm\npmrc
ERR! prefix directory not found
ERR! Error: ENOENT, no such file or directory 'c:\node\~\AppData\Roaming\npm'
ERR! Report this *entire* log at:
ERR!
ERR! or email it to:
ERR!
ERR!
ERR! System Windows_NT 6.1.7601
ERR! command "node" "C:\\Users\\cam\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "express" "--verbose"
ERR! cwd c:\node
ERR! node -v v0.6.5
ERR! npm -v 1.1.0-beta-5
ERR! path c:\node\~\AppData\Roaming\npm
ERR! code ENOENT
ERR! message ENOENT, no such file or directory 'c:\node\~\AppData\Roaming\npm'
verbose exit [ 1, true ]

I looked at my npmrc file and it contains:

prefix = ~\AppData\Roaming\npm

Shouldn't it say instead either one of:

* `prefix = %AppData%\npm`
* `prefix = %UserProfile%\AppData\Roaming\npm`

(For my computer with Windows 7, `%AppData%` is the same as `%UserProfile%\AppData\Roaming`.)