Issue
2 days ago, every global install I made, modules were put into /opt/node/lib/node_modules
. Suddenly, every new global install is thrown into /usr/lib/node_modules
.
Where could that behavior come from ? I have no .npmrc file anywhere, running on Debian. What can I do to retrieve the "old"behavior (installs in /opt/node/lib/node_modules)
Also, when I make npm list
, it return only the modules in /usr/lib... and omits the 20 other modules I got in /opt/lib/node/...
I would like a config way of dealing with this, thanks
Here is the result of npm config ls -l
; cli configs
long = true
registry = "https://registry.npmjs.org/"
; default values
always-auth = false
bin-links = true
browser = null
ca = null
cache = "/root/.npm"
cache-lock-retries = 10
cache-lock-stale = 60000
cache-lock-wait = 10000
cache-max = null
cache-min = 10
cert = null
color = true
depth = null
description = true
dev = false
editor = "vi"
email = ""
engine-strict = false
fetch-retries = 2
fetch-retry-factor = 10
fetch-retry-maxtimeout = 60000
fetch-retry-mintimeout = 10000
force = false
git = "git"
git-tag-version = true
global = false
globalconfig = "/usr/etc/npmrc"
globalignorefile = "/usr/etc/npmignore"
group = "33"
heading = "npm"
https-proxy = null
ignore-scripts = false
init-module = "/root/.npm-init.js"
init.author.email = ""
init.author.name = ""
init.author.url = ""
init.license = "ISC"
json = false
key = null
link = false
local-address = undefined
loglevel = "http"
; long = false (overridden)
message = "%s"
node-version = "v0.10.25"
npat = false
onload-script = false
optional = true
parseable = false
prefix = "/usr"
production = false
proprietary-attribs = true
proxy = null
rebuild-bundle = true
registry = "https://registry.npmjs.org/"
rollback = true
save = false
save-bundle = false
save-dev = false
save-optional = false
searchexclude = null
searchopts = ""
searchsort = "name"
shell = "/bin/bash"
shrinkwrap = true
sign-git-tag = false
strict-ssl = true
tag = "latest"
tmp = "/root/tmp"
umask = 18
unicode = true
unsafe-perm = false
usage = false
user = 1001
user-agent = "node/v0.10.25 linux arm"
userconfig = "/root/.npmrc"
username = ""
version = false
versions = false
viewer = "man"
Global config file ( /usr/etc/npmrc
) doesn't exist
Solution
Try to run npm config set prefix /opt/node
, this should set a proper path to your config.
Answered By - alex