在Mac上安装foundation-cli时出现问题

时间:2018-12-19 07:25:39

标签: zurb-foundation

我是foundation-cli的新手,并且已经在论坛中进行搜索。

我试图将其安装在2012年末的iMac上几次,但总是收到警告和错误。我有什么可以做的吗?还是必须在没有cli的情况下继续使用基础?

安装Foundation-cli我收到此消息:

**(sudo npm install -g foundation-cli
Password:)**

npmWARNdeprecated bower@1.8.4: We don't recommend using Bower for new projects. Please consider Yarn and Webpack or Parcel. You can read how to migrate legacy project here: https://bower.io/blog/2017/how-to-migrate-away-from-bower/

npmWARNdeprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js

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

+ foundation-cli@2.2.5

added 324 packages from 530 contributors in 12.579s

,然后新成立的基金会提出了这一点:

foundation new

/usr/local/lib/node_modules/foundation-cli/node_modules/bower/lib/node_modules/configstore/index.js:54

throw err;

^



Error: EACCES: permission denied, open '/Users/ferdinand/.config/configstore/bower-github.json'

You don't have access to this file.



at Object.openSync (fs.js:439:3)

at Object.readFileSync (fs.js:344:35)

at Configstore.get (/usr/local/lib/node_modules/foundation-cli/node_modules/bower/lib/node_modules/configstore/index.js:35:26)

at new Configstore (/usr/local/lib/node_modules/foundation-cli/node_modules/bower/lib/node_modules/configstore/index.js:28:45)

at readCachedConfig (/usr/local/lib/node_modules/foundation-cli/node_modules/bower/lib/config.js:19:23)

at defaultConfig (/usr/local/lib/node_modules/foundation-cli/node_modules/bower/lib/config.js:11:12)

at Object.<anonymous> (/usr/local/lib/node_modules/foundation-cli/node_modules/bower/lib/index.js:16:32)

at Module._compile (internal/modules/cjs/loader.js:689:30)

at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)

at Module.load (internal/modules/cjs/loader.js:599:32)

1 个答案:

答案 0 :(得分:1)

您可以解决安装CLI的权限错误,但我建议您进行手动安装,实际上只需两个步骤即可。

您可以克隆CLI使用的模板:(将项目名称更改为所需的名称)

git clone https://github.com/zurb/foundation-zurb-template projectname

然后将cd插入该项目并运行

yarn