Reputation:
I get the following error when installing Polymer CLI as follows
sudo npm install -g polymer-cli
29577 info lifecycle [email protected]~install: [email protected]
29578 verbose lifecycle [email protected]~install: unsafe-perm in lifecycle false
29579 verbose lifecycle [email protected]~install: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/lib/node_modules/polymer-cli/node_modules/wd/node_modules/.bin:/usr/lib/node_modules/polymer-cli/node_modules/.bin:/usr/lib/node_modules/.bin:/usr/local/sbin:/usr/loc\
al/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
29580 verbose lifecycle [email protected]~install: CWD: /usr/lib/node_modules/polymer-cli/node_modules/wd
29581 silly lifecycle [email protected]~install: Args: [ '-c', 'node scripts/build-browser-scripts' ]
29582 silly lifecycle [email protected]~install: Returned: code: 1 signal: null
29583 info lifecycle [email protected]~install: Failed to exec install script
29584 verbose unlock done using /root/.npm/_locks/staging-a072192f34a17023.lock for /usr/lib/node_modules/.staging
29585 verbose stack Error: [email protected] install: `node scripts/build-browser-scripts`
29585 verbose stack Exit status 1
29585 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
29585 verbose stack at EventEmitter.emit (events.js:160:13)
29585 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
29585 verbose stack at ChildProcess.emit (events.js:160:13)
29585 verbose stack at maybeClose (internal/child_process.js:943:16)
29585 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
29586 verbose pkgid [email protected]
Any idea how to fix it?
UPDATE
I updated the npm
and bower
to the latest versions and then ran the install command again for polymer-cli
. Now I get the following error message - it's a permissioning problem when running the script. I am not sure if this is down to the npm install script or if it is an arch linux problem.
sudo npm install -g polymer-cli
npm WARN deprecated [email protected]: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated [email protected]: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
npm WARN deprecated [email protected]: 'github' has been renamed to '@octokit/rest' (https://git.io/vNB11)
npm WARN deprecated @types/[email protected]: See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/12826
/usr/bin/polymer -> /usr/lib/node_modules/polymer-cli/bin/polymer.js
> [email protected] install /usr/lib/node_modules/polymer-cli/node_modules/uws
> node-gyp rebuild > build_log.txt 2>&1 || exit 0
sh: build_log.txt: Permission denied
> [email protected] install /usr/lib/node_modules/polymer-cli/node_modules/wd
> node scripts/build-browser-scripts
/usr/lib/node_modules/polymer-cli/node_modules/mkdirp/index.js:90
throw err0;
^
Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/polymer-cli/node_modules/wd/build'
at Object.fs.mkdirSync (fs.js:905:18)
at sync (/usr/lib/node_modules/polymer-cli/node_modules/mkdirp/index.js:71:13)
at Object.<anonymous> (/usr/lib/node_modules/polymer-cli/node_modules/wd/scripts/build-browser-scripts.js:6:1)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Function.Module.runMain (module.js:701:10)
at startup (bootstrap_node.js:193:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node scripts/build-browser-scripts`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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! /root/.npm/_logs/2018-01-28T19_51_38_197Z-debug.log
The issue now is when the script tries to make this directory:
mkdir '/usr/lib/node_modules/polymer-cli/node_modules/wd/build'
Upvotes: 2
Views: 287
Reputation: 3085
--unsafe-perm
option to install polymer-cli globally as described heresudo npm install -g polymer-cli --unsafe-perm
and then install npm install -g polymer-cli
without sudo and --unsafe-perm
option.
Upvotes: 3
Reputation:
Switched to Yarn and it installs!
sudo yarn global add polymer-cli
yarn global v1.3.2
[1/4] Resolving packages...
warning polymer-cli > [email protected]: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
warning polymer-cli > [email protected]: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
warning polymer-cli > [email protected]: 'github' has been renamed to '@octokit/rest' (https://git.io/vNB11)
warning polymer-cli > polyserve > @types/[email protected]: See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/12826
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
- polymer
Done in 61.35s.
Upvotes: 1