尝试创建反应项目时出现权限错误:
➜ myproject sudo npm install npm@latest -g
[sudo] Mot de passe de julien :
/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
+ npm@6.3.0
added 283 packages, removed 363 packages and updated 41 packages in 12.239s
➜ myproject npm -v
6.3.0
➜ myproject sudo npm install -g reaction-cli
npm WARN deprecated command-exists@1.2.2: Potential security vulnerability fixed in v.1.2.4
/usr/local/bin/reaction -> /usr/local/lib/node_modules/reaction-cli/dist/main.js
/usr/local/bin/rc -> /usr/local/lib/node_modules/reaction-cli/dist/main.js
+ reaction-cli@0.29.0
updated 2 packages in 17.817s
➜ myproject sudo reaction init
Cloning the master branch of Reaction from Github...
Clonage dans 'reaction'...
remote: Counting objects: 131122, done.
remote: Compressing objects: 100% (50/50), done.
remote: Total 131122 (delta 18), reused 40 (delta 12), pack-reused 131059
Réception d'objets: 100% (131122/131122), 48.39 MiB | 421.00 KiB/s, fait.
Résolution des deltas: 100% (74545/74545), fait.
Installing NPM packages...
npm ERR! write after end
npm ERR! A complete log of this run can be found in:
npm ERR! /home/julien/.npm/_logs/2018-08-02T09_05_18_750Z-debug.log
Error: Node modules were not successfully installed. Exiting.
注意,几天前我在USB HDD上安装了Ubuntu。我昨天安装了nvm(npm-v = 6.3.0)。
我想这是一个权限问题,但是我是Linux操作系统上的新手,您有建议吗?