mac os npm yo 安装完成 yo react-webpack

zandeMacBook-Pro:yo zan$ sudo npm install -g yo
Password:
 
> spawn-sync@1.0.13 postinstall /usr/local/lib/node_modules/yo/node_modules/cross-spawn/node_modules/spawn-sync
> node postinstall

/usr/local/bin/yo -> /usr/local/lib/node_modules/yo/lib/cli.js

> yo@1.4.8 postinstall /usr/local/lib/node_modules/yo
> yodoctor


Yeoman Doctor
Running sanity checks on your system

✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ Node.js version
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✔ npm version

Everything looks all right!
yo@1.4.8 /usr/local/lib/node_modules/yo
├── titleize@1.0.0
├── array-uniq@1.0.2
├── async@1.4.2
├── figures@1.4.0
├── humanize-string@1.0.1 (decamelize@1.0.0)
├── opn@3.0.2 (object-assign@3.0.0)
├── yeoman-character@1.0.1 (supports-color@1.3.1)
├── lodash@3.10.1
├── user-home@2.0.0 (os-homedir@1.0.1)
├── string-length@1.0.1 (strip-ansi@3.0.0)
├── sort-on@1.2.2 (arrify@1.0.0, dot-prop@2.2.0)
├── chalk@1.1.1 (escape-string-regexp@1.0.3, ansi-styles@2.1.0, supports-color@2.0.0, strip-ansi@3.0.0, has-ansi@2.0.0)
├── update-notifier@0.5.0 (is-npm@1.0.0, latest-version@1.0.1, semver-diff@2.0.0)
├── repeating@1.1.3 (is-finite@1.0.1)
├── findup@0.1.5 (commander@2.1.0, colors@0.6.2)
├── yosay@1.0.5 (ansi-regex@1.1.1, word-wrap@1.1.0, ansi-styles@2.1.0, strip-ansi@2.0.1, pad-component@0.0.1, minimist@1.2.0, taketalk@1.0.0, string-width@1.0.1)
├── root-check@1.0.0 (sudo-block@1.2.0, downgrade-root@1.1.0)
├── fullname@1.1.1 (npmconf@2.1.2)
├── yeoman-environment@1.2.7 (diff@1.4.0, log-symbols@1.0.2, escape-string-regexp@1.0.3, text-table@0.2.0, untildify@2.1.0, debug@2.2.0, grouped-queue@0.3.0, globby@2.1.0, inquirer@0.8.5, mem-fs@1.1.0)
├── configstore@1.2.1 (object-assign@3.0.0, os-tmpdir@1.0.1, graceful-fs@4.1.2, uuid@2.0.1, mkdirp@0.5.1, osenv@0.1.3, xdg-basedir@2.0.0, write-file-atomic@1.1.3)
├── meow@3.4.2 (loud-rejection@1.0.0, trim-newlines@1.0.0, object-assign@4.0.1, minimist@1.2.0, redent@1.0.0, camelcase-keys@1.0.0, normalize-package-data@2.3.4, read-pkg-up@1.0.1)
├── got@4.2.0 (lowercase-keys@1.0.0, timed-out@2.0.0, is-stream@1.0.1, is-redirect@1.0.0, prepend-http@1.0.3, is-plain-obj@1.0.0, object-assign@3.0.0, node-status-codes@1.0.0, unzip-response@1.0.0, pinkie-promise@1.0.0, create-error-class@2.0.1, parse-json@2.2.0, duplexify@3.4.2, read-all-stream@3.0.1)
├── npm-keyword@1.2.0 (registry-url@3.0.3, got@3.3.1)
├── package-json@1.2.0 (registry-url@3.0.3, got@3.3.1)
├── inquirer@0.9.0 (ansi-regex@2.0.0, strip-ansi@3.0.0, cli-width@1.0.1, rx-lite@2.5.2, through@2.3.8, readline2@0.1.1, run-async@0.1.0)
├── cross-spawn@0.4.1 (lru-cache@2.7.0, spawn-sync@1.0.13)
├── insight@0.6.0 (object-assign@2.1.1, async@0.9.2, tough-cookie@1.2.0, lodash.debounce@3.1.1, os-name@1.0.3, inquirer@0.8.5, request@2.65.0)
└── yeoman-doctor@1.4.0 (object-values@1.0.0, log-symbols@1.0.2, user-home@1.1.1, semver@4.3.6, each-async@1.1.1, twig@0.8.2, bin-version-check@2.1.0)

以上yo 全局安装完成 ;

但敲入 yo react-webpack

zandeMacBook-Pro:react-yo zan$  yo react-webpack
/usr/local/lib/node_modules/yo/node_modules/configstore/index.js:46
                throw err;
                ^

Error: EACCES: permission denied, open '/Users/zan/.config/configstore/insight-yo.json'
You don't have access to this file.

    at Error (native)
    at Object.fs.openSync (fs.js:549:18)
    at Object.fs.readFileSync (fs.js:397:15)
    at Object.create.all.get (/usr/local/lib/node_modules/yo/node_modules/configstore/index.js:27:26)
    at Object.Configstore (/usr/local/lib/node_modules/yo/node_modules/configstore/index.js:20:44)
    at new Insight (/usr/local/lib/node_modules/yo/node_modules/insight/lib/index.js:37:34)
    at Object.<anonymous> (/usr/local/lib/node_modules/yo/lib/cli.js:128:15)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)

怎么办呀

有大神们指导一下码

阅读 5.8k
2 个回答
新手上路,请多包涵

没有权限,用管理员权限看看呢

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题