Polymer cli无法在macOS上初始化元素,入门工具包和应用程序

我的需求系统:

macOS Mojave 10.14.5

自制

纱^ 1.21.1

npm ^ 6.13.4

节点v12.13.1

重现此问题的步骤

首先,我尝试安装Polymer cli。 我在终端输入以下内容

npm install -g凉亭 安装Polymer CLI。 须藤npm install -g polymer-cli

会出现这样的错误

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

> fsevents@1.2.9 install /usr/local/lib/node_modules/polymer-cli/node_modules/fsevents
> node install

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Pre-built binaries not installable for fsevents@1.2.9 and node@12.13.1 (node-v72 ABI,unknown) (falling back to source compile with node-gyp) 
node-pre-gyp WARN Hit error EaccES: permission denied,mkdir '/usr/local/lib/node_modules/polymer-cli/node_modules/fsevents/lib' 
gyp WARN EaccES current user ("nobody") does not have permission to access the dev dir "/Users/asep/library/Caches/node-gyp/12.13.1"
gyp WARN EaccES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/polymer-cli/node_modules/fsevents/.node-gyp"
gyp WARN install got an error,rolling back install
gyp WARN install got an error,rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: EaccES: permission denied,mkdir '/usr/local/lib/node_modules/polymer-cli/node_modules/fsevents/.node-gyp'
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/local/lib/node_modules/polymer-cli/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node" "--module_name=fse" "--module_path=/usr/local/lib/node_modules/polymer-cli/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /usr/local/lib/node_modules/polymer-cli/node_modules/fsevents
gyp ERR! node -v v12.13.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/polymer-cli/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/polymer-cli/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/polymer-cli/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
node-pre-gyp ERR! stack     at maybeclose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
node-pre-gyp ERR! System Darwin 18.7.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/polymer-cli/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/polymer-cli/node_modules/fsevents
node-pre-gyp ERR! node -v v12.13.1
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/polymer-cli/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/polymer-cli/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)

> wd@1.11.2 install /usr/local/lib/node_modules/polymer-cli/node_modules/wd
> node scripts/build-browser-scripts

/usr/local/lib/node_modules/polymer-cli/node_modules/mkdirp/index.js:90
                    throw err0;
                    ^

Error: EaccES: permission denied,mkdir '/usr/local/lib/node_modules/polymer-cli/node_modules/wd/build'
    at Object.mkdirSync (fs.js:823:3)
    at sync (/usr/local/lib/node_modules/polymer-cli/node_modules/mkdirp/index.js:71:13)
    at Object.<anonymous> (/usr/local/lib/node_modules/polymer-cli/node_modules/wd/scripts/build-browser-scripts.js:6:1)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runmain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11 {
  errno: -13,syscall: 'mkdir',code: 'EaccES',path: '/usr/local/lib/node_modules/polymer-cli/node_modules/wd/build'
}
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/polymer-cli/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! wd@1.11.2 install: `node scripts/build-browser-scripts`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the wd@1.11.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/asep/.npm/_logs/2020-01-07T09_45_01_701Z-debug.log
(base) Aseps-MacBook-Pro:~ asep$ yarn remove polymer-cli
yarn remove v1.21.1
[1/2] ?  Removing module polymer-cli...
error This module isn't specified in a package.json file.
info Visit https://yarnpkg.com/en/docs/cli/remove for documentation about this command.

并添加--unsafe-perm进行安装

npm install -g bower --unsafe-perm

安装Polymer CLI。

sudo npm install -g polymer-cli --unsafe-perm

nb:不出现--unsafe-perm错误

所以我可以在终端中键入聚合物并显示所有这样的命令 succes install polymer cli in terminal

完成检查聚合物的安装后,我尝试启动一个项目 mkdir polymer-admin或polymeradmin cd聚合物管理员或聚合物管理员 聚合物初始 并在下面显示这样的选项

the result of polymer init

当我在聚合物初始化中选择一个选项时 错误发生

error when choosing one of all-polymer init options

我的问题是如何解决这个问题?

heishashengzhe111 回答:Polymer cli无法在macOS上初始化元素,入门工具包和应用程序

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2809925.html

大家都在问