与https://docs.microsoft.com/en-us/office/dev/add-ins/quickstarts/word-quickstart?tabs=visual-studio-code一样安装npm install -g yo generator-office
。运行yo后,获得以下信息:
/usr/local/lib/node_modules/yo/node_modules/write-file-atomic/index.js:197
throw err
^
Error: EACCES: permission denied, open '/Users/amarshanand/Library/Preferences/insight-nodejs/insight-yo.json.4213605520'
at Object.fs.openSync (fs.js:646:18)
at Function.writeFileSync [as sync] (/usr/local/lib/node_modules/yo/node_modules/write-file-atomic/index.js:180:17)
at Conf.set store [as store] (/usr/local/lib/node_modules/yo/node_modules/conf/index.js:142:19)
at new Conf (/usr/local/lib/node_modules/yo/node_modules/conf/index.js:44:14)
at new Insight (/usr/local/lib/node_modules/yo/node_modules/insight/lib/index.js:40:35)
at Object.<anonymous> (/usr/local/lib/node_modules/yo/lib/cli.js:46:17)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
实际上,文件insight-yo.json.4213605520
甚至不存在。存在的是insight-yo.json
。知道有什么问题吗?
版本:
+ generator-office@1.1.14
+ yo@2.0.4
答案 0 :(得分:0)
是另一个权限问题。通过运行解决了它
sudo chown -R $USER /Users/amarshanand/Library/Preferences/insight-nodejs/