You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you move cache directory to new location and update config you have error with old cache files
For example:
old location: /Users/alimd/.npm/lazy_cache/
new location: /DevTools/npm/lazy_cache
npm error:
app info npm_lazy at 0.0.0.0 port 4114
app info npm_lazy cache directory: /DevTools/npm/lazy_cache
app debug [GET] http://registry.npmjs.org/babel-generator
app debug cache get http://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.7.4.tgz
app debug [GET] http://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.7.4.tgz
app debug [304] http://registry.npmjs.org/path-exists
fs.js:584
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT: no such file or directory, open '/Users/alimd/.npm/lazy_cache/9kyedi2g3krzfr'
at Error (native)
at Object.fs.openSync (fs.js:584:18)
at Object.fs.readFileSync (fs.js:431:33)
at /DevTools/npm/lib/node_modules/npm_lazy/lib/package.js:100:63
at /DevTools/npm/lib/node_modules/npm_lazy/lib/resource.js:159:5
at Lifecycle.<anonymous> (/DevTools/npm/lib/node_modules/npm_lazy/lib/lifecycle.js:32:7)
at Lifecycle.c (/DevTools/npm/lib/node_modules/npm_lazy/node_modules/microee/index.js:34:13)
at Lifecycle.M.emit (/DevTools/npm/lib/node_modules/npm_lazy/node_modules/microee/index.js:23:12)
at Lifecycle.release (/DevTools/npm/lib/node_modules/npm_lazy/lib/lifecycle.js:19:10)
at Resource._afterFetch (/DevTools/npm/lib/node_modules/npm_lazy/lib/resource.js:251:11)
as you can see cache dir setting changed but npmlazy try to open old folder!, it work for new cached module and this bug just happened for old cached modules
My config
varpath=require('path'),homePath=path.normalize(process.env['NPM_HOME']);module.exports={// Logging configloggingOpts: {// Print to stdout with colorslogToConsole: true,// Write to filelogToFile: false,// This should be a file path.filename: homePath+'/npm_lazy.log'},// Cache config// `cacheDirectory`: Directory to store cached packages.//// Note: Since any relative path is resolved relative to the current working// directory when the server is started, you should use a full path.cacheDirectory: homePath+'/lazy_cache',// `cacheAge`: maximum age before an index is refreshed from remoteUrl// - negative value means no refresh (e.g. once cached, never update the package.json metadata)// - zero means always refresh (e.g. always ask the registry for metadata)// - positive value means refresh every n milliseconds// (e.g. 60 * 60 * 1000 = expire metadata every 60 minutes)//// Note: if you want to use `npm star` and other methods which update// npm metadata, you will need to set cacheAge to 0. npm generally wants the latest// package metadata version so caching package metadata will interfere with it.// Recommended setting: 0cacheAge: 7*24*60*60*1000,// Request config// max milliseconds to wait for each HTTP responsehttpTimeout: 20000,// maximum number of retries per HTTP resource to getmaxRetries: 5,// whether or not HTTPS requests are checked against Node's list of CAs// set false if you are using your own npm mirror with a self-signed SSL certrejectUnauthorized: false,// Remote and local URL// external url to npm_lazy, no trailing /externalUrl: 'http://localhost:4114',// registry url with trailing /remoteUrl: 'http://registry.npmjs.org/',// bind port and hostport: 4114,host: '0.0.0.0',// Proxy config// You can also configure this using the http_proxy and https_proxy environment variables// cf. https://wiki.archlinux.org/index.php/proxy_settingsproxy: {// http: 'http://1.2.3.4:80/',// https: 'http://4.3.2.1:80/'}};
If you clear the cache maybe this problem solved but if you want to keep old cache files you must to make a symbolic link new dir to old !
The text was updated successfully, but these errors were encountered:
When you move cache directory to new location and update config you have error with old cache files
For example:
old location:
/Users/alimd/.npm/lazy_cache/
new location:
/DevTools/npm/lazy_cache
npm error:
as you can see cache dir setting changed but npmlazy try to open old folder!, it work for new cached module and this bug just happened for old cached modules
My config
If you clear the cache maybe this problem solved but if you want to keep old cache files you must to make a symbolic link new dir to old !
The text was updated successfully, but these errors were encountered: