Tôi đang cố gắng thiết lập yo để sử dụng trình tạo góc cho một dự án. Tôi đang thực hiện theo các bước được hủy tại đây: http://yeoman.io/learning/index.htmlQuyền bị từ chối khi cài đặt Yo
Tôi đã cài đặt Node.js và NPM.
Nhưng khi tôi sử dụng lệnh:
sudo npm install -g yo bower grunt-cli
Nó thất bại và tôi nhận được lỗi này:
> [email protected] postinstall /usr/lib/node_modules/yo/node_modules/cross-spawn/node_modules/spawn-sync
> node postinstall
fs.js:439
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EACCES, permission denied '/usr/lib/node_modules/yo/node_modules/cross-spawn/node_modules/spawn-sync/package.json'
at Object.fs.openSync (fs.js:439:18)
at Object.fs.writeFileSync (fs.js:978:15)
at Object.<anonymous> (/usr/lib/node_modules/yo/node_modules/cross-spawn/node_modules/spawn-sync/postinstall.js:20:6)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:935:3
npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "node" "/usr/bin/npm" "install" "-g" "yo"
npm ERR! node v0.10.37
npm ERR! npm v2.11.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: `node postinstall`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node postinstall'.
npm ERR! This is most likely a problem with the spawn-sync package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node postinstall
npm ERR! You can get their info via:
npm ERR! npm owner ls spawn-sync
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/vincent/npm-debug.log
Tôi cố gắng để sử dụng chmod 777 on /usr/lib/node_modules
nhưng nó dường như không làm việc tốt hơn.
Tôi có thể cài đặt Bower và Grunt, nó làm việc, nhưng khi tôi cố gắng để cài đặt Yo, nó thất bại mọi ...
Tôi không có ý tưởng gì để làm như tất cả mọi thứ tôi đã cố gắng sử dụng chmod
hoặc chown
không công việc.
Cảm ơn các bạn đã giúp đỡ! :)
Cảm ơn rất nhiều! Nó làm việc hoàn hảo :) –
Từ những gì tôi hiểu bằng cách sử dụng sudo đây không phải là một ý tưởng hay, xem [câu trả lời này] (http://stackoverflow.com/a/24404451/967168) để có một giải pháp tốt hơn –