1, the NPM. Config. The loaded? npm.config.get(‘_exit’) : true

Error: EINVAL: invalid argument, mkdir 'G: \ blog_github \ "F: \ SP \ node \ node_global"; '
TypeError: Cannot read property 'loaded' of undefined
    at exit(E: blog \node\node_modules\ NPM \lib\utils\error-handler.js:97:27) at errorHandler (E: blog \node\node_modules\ NPM \lib\utils\error-handler.js:97:27 (E: blog \node\node_modules\ NPM \lib\utils\error-handler.js:216:3) at E: blog \node\node_modules\ NPM \bin\npm-cli.js:78:20 at cb (E: blog \node\node_modules\ NPM \lib\npm.js:225:22) at E: blog \node\node_modules\ NPM \lib\npm.js:263:24 at E: blog \node\node_modules\ NPM \lib\config\core.js:81:7 at array. forEach (<anonymous>) at E: blog \node\node_modules\ NPM \lib\config\core.js:80:13 at f (E: blog \node\node_modules\ NPM \node_modules\once\once. Js :25:25) At afterExtras (E: blog \node\node_modules\ NPM \lib\config\core.js:171:20) E: blog \node\node_modules\ NPM \lib\utils\error-handler.js:97 var doExit = npm.config.loaded? npm.config.get('_exit') : true
                          ^

TypeError: Cannot read property 'loaded' of undefined
    at exit(E: blog \node\node_modules\ NPM \lib\utils\error-handler.js:97:27) at process.errorHandler (E: blog \node\node_modules\ NPM \lib\utils\error-handler.js:97:27) at process.errorHandler (E: blog \node\node_modules\ NPM \lib\utils\error-handler.js:216:3) at process.emit (events.js:210:5) at process._fatalException (internal/process/execution.js:150:25)Copy the code

To solve

  • The first:

Open the following files in the editor: /usr/local/lib/node_modules/ NPM /node_modules/uid-number/uid-number.js to line 11, Change uidSupport = process. getuid&& process.setuid to uidSupport = false

  • The second:

Delete /Users/ {user directory} /.npmrc

  • The third:

NPM config get prefix = NPM config get prefix = NPM config get prefix = NPM config get prefix = NPM config get prefix

Blog.csdn.net/qq_43511842…

2, NPM link

NPM Link makes it easy to debug the development library, with a few caveats:

  • Directory address, see to link to the correct address
  • It needs to be used on Macsudo

3. Set the proxy

$ npm config setProxy =http://127.0.0.1:8087 $NPM config Delete proxy $NPM configset registry=http://registry.npmjs.org
Copy the code

4, strange error

Unexpected end of JSON input while parsing near '... 75189a47b39759b783e",'
Copy the code

5. User name

# check
$ git config user.name
$ git config user.email

# set
$ git config --global user.name "username"
$ git config --global user.email "email"
Copy the code