1
votes

NPM has been installed by the Azure DevOps agent install on my mac os Mojave v10.14.6. I can access the npm but any commadn gives tha same error. this is the only command that work sudo npm --version =6.12.0 sudo npm -p process.platform = darwin

this is the same error message I get for any other command:

Error: EISDIR: illegal operation on a directory, read TypeError: Cannot read property 'loaded' of undefined at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97:27) at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3) at /usr/local/lib/node_modules/npm/bin/npm-cli.js:78:20 at cb (/usr/local/lib/node_modules/npm/lib/npm.js:225:22) at /usr/local/lib/node_modules/npm/lib/npm.js:263:24 at /usr/local/lib/node_modules/npm/lib/config/core.js:81:7 at Array.forEach () at /usr/local/lib/node_modules/npm/lib/config/core.js:80:13 at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25) at finalize (/usr/local/lib/node_modules/npm/lib/config/core.js:187:14) /usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97 var doExit = npm.config.loaded ? npm.config.get('_exit') : true

I have downloaded the latest version node version from nodejs.org and this has not help. I believe the problem is that it is missing the .npmrc but i might be wrong. I ran locate command and here are all the results anything under deb/myagent is azure devops pulled source for building the apps:

Mac-mini:/ sedev$ locate .npmrc

/Applications/Xcode.app/Contents/Developer/usr/share/xcs/xcsd/node_modules/nsp/node_modules/npmconf/test/fixtures/.npmrc
/Applications/Xcode.app/Contents/Developer/usr/share/xcs/xcsd/node_modules/nsp/node_modules/silent-npm-registry-client/node_modules/npm-registry-client/node_modules/npmlog/.npmrc
/Users/sedev/.npmrc
/Users/sedev/myagent/_work/10/s/app.WebUi/wwwroot/bower_components/vaadin-checkbox/.npmrc
/Users/sedev/myagent/_work/10/s/app.WebUi/wwwroot/bower_components/vaadin-control-state-mixin/.npmrc
/Users/sedev/myagent/_work/10/s/app.WebUi/wwwroot/bower_components/vaadin-element-mixin/.npmrc
/Users/sedev/myagent/_work/10/s/app.WebUi/wwwroot/bower_components/vaadin-grid/.npmrc
/Users/sedev/myagent/_work/10/s/app.WebUi/wwwroot/bower_components/vaadin-grid-5.0.0-alpha6/.npmrc
/Users/sedev/myagent/_work/10/s/app.WebUi/wwwroot/bower_components/vaadin-icons/.npmrc
/Users/sedev/myagent/_work/10/s/app.WebUi/wwwroot/bower_components/vaadin-text-field/.npmrc
/Users/sedev/myagent/_work/10/s/app.WebUi/wwwroot/bower_components/vaadin-themable-mixin/.npmrc
Mac-mini:/ sedev$ 
3

3 Answers

4
votes

The answer was the .npmrc was corrupt or something. I had to remove it and it worked sudo rm /Users/sedev/.npmrc

0
votes

It Is Possible someTime That Node has crashed. so solution Is That Uninstall NodeJs and Install it Againg

0
votes

Install for [ 'browserslist@latest' ] => npm i browserslist@latest