Mac bower install bootstrap bug resolved

Recently, I have been using vue and vue-based UI frameworks, such as Element. I haven't used BootStrap for some years. I don't know why tonight I suddenly want to install BootStrap to my own small project. When using bower to install, the following error has been reported:
/ usr/local/lib/node_modules/bower/lib/node_modules/configstore/index.js:54
throw err;
^
Error: EACCES: permission denied, open '/Users/XiaoQiang/.config/configstore/bower-github.json'
You don't have access to this file.
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.readFileSync (fs.js:508:33)
at Object.create. all.get (/usr/local/lib/node_modules/bower/lib/node_modules/configstore/index.js:35:26)
at Object.Configstore (/usr/local/lib/node_modules/bower/lib/node_modules/configstore /index.js:28:44)
at readCachedConfig (/usr/local/lib/node_modules/bower/lib/config.js:19:23)
at defaultConfig (/usr/local/lib/node_modules/bower/lib/config.js:11:12)
at Object. (/usr/local/lib/node_modules/bower/lib/index.js:16:32)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)

Baidu has checked a lot of methods and found that it is useless. The most common statement is this:

sudo bower install –allow-root
sudo bower install

The pro test is not available, I feel that the answers are all copied and pasted, and the reference value is not high.

Finally found a solution on github, which is available for personal testing.

sudo chown -R U S E R : GROUP ~/.npm
sudo chown -R U S E R : GROUP ~/.config

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325446725&siteId=291194637