Failed to download Chromium Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download - polymer

I am trying to install polymer-cli version 3 in my Windows and I am getting the error mentioned in this question. Searching around I reach that it is a problem with kind of PDF Generator from NPM dependencies. Sincerely, it doesn't make sense to me but I still try follow the recommendation mentioned in https://github.com/webpro/reveal-md/issues/191.
Bellow, the full error:
C:\dev\polymer2\sample>npm install -g polymer-cli#next --no-optional
C:\Users\my-user\AppData\Roaming\npm\polymer -> C:\Users\my-user\AppData\Roaming\npm\node_modules\polymer-cli\bin\poly
mer.js
> puppeteer#1.3.0 install C:\Users\my-user\AppData\Roaming\npm\node_modules\polymer-cli\node_modules\puppeteer
> node install.js
ERROR: Failed to download Chromium r549031! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: getaddrinfo ENOTFOUND storage.googleapis.com storage.googleapis.com:443
at errnoException (dns.js:50:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
code: 'ENOTFOUND',
errno: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'storage.googleapis.com',
host: 'storage.googleapis.com',
port: 443 }
npm WARN rollback Rolling back debug#3.1.0 failed (this is probably harmless): EPERM: operation not permitted, scandir '
C:\Users\my-user\AppData\Roaming\npm\node_modules\polymer-cli\node_modules\puppeteer\node_modules\https-proxy-agent\nod
e_modules'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.3 (node_modules\polymer-cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.3: wanted {"os":"darwin","arch":"any
"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: puppeteer#1.3.0 (node_modules\polymer-cli\node_modules\puppeteer):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: puppeteer#1.3.0 install: `node install.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
+ polymer-cli#1.7.0-pre.17
updated 1 package in 15.762s
C:\dev\polymer2\sample>polymer --version
1.7.0-pre.17

Related

How to install pm2-logrotate

I am trying to install pm2-logrotate,
sudo pm2 install pm2-logrotate
I am getting
[PM2][Module] Installing NPM pm2-logrotate module
[PM2][Module] Calling [NPM] to install pm2-logrotate ...
npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/pm2-logrotate failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org
npm ERR! A complete log of this run can be found in:
npm ERR! /home/moveoadm/.npm/_logs/2022-09-11T12_58_10_842Z-debug.log
[PM2][ERROR] Installation failed via NPM, module has been restored to prev version
Looks like npm cannot resolve registry.npmjs.org, i.e. it not connected to Internet.
There are a lot of reasons, for instance, docker configuration - look at What's the cause of the error 'getaddrinfo EAI_AGAIN'?

npm install cannot find package.json from dependencies of each dependency

Recently, I found myself unable to install with npm my js packages.
I tried to do every basic command that generally unlock thoses kind of weird bug but here it doesn't change a thing.
I did the following, multiple times :
rm -rf node_modules
npm cache clean --force
re clone my project git clone <my-project>
reinstall vagrant box laravel/homestead (fresh npm + nodejs)
Installed n and tried different versions of nodejs/npm
I run the npm command inside the virtual machine Homestead which runs :
Homestead 9.4.0
Ubuntu 18.04
npm 6.14.4
node.js v12.16.1
My package.json
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.17",
"bootstrap": "^4.3",
"cross-env": "^5.1",
"jquery": "^3.4.1",
"laravel-mix": "^1.0",
"lodash": "^4.17.4",
"popper.js": "^1.16.1",
"vue": "^2.6.11"
},
"dependencies": {
"#fortawesome/fontawesome-free": "^5.12.1",
"leaflet": "^1.5.1",
"leaflet-draw": "^1.0.3",
"leaflet-polylinedecorator": "^1.6.0",
"leaflet.control.layers.tree": "^0.1.1",
"vue-search-select": "^2.6.2",
"vuex": "^3.1.3"
}
}
And I get the following error which is changing time to time from different package and if I install them manually the same error appears with another package. Always trying to find the package.json from a sub-dependecies in its node_modules. Which is really weird.
vagrant#homestead:~/project$ npm install
npm WARN deprecated popper.js#1.16.1: You can find the new Popper v2 at #popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated extract-text-webpack-plugin#3.0.2: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin
npm WARN deprecated browserslist#2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated core-js#2.6.11: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
npm WARN deprecated browserslist#1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated gulp-util#3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN notsup Unsupported engine for got#5.7.1: wanted: {"node":">=0.10.0 <7"} (current: {"node":"12.16.1","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: got#5.7.1
npm WARN ajv-keywords#3.4.1 requires a peer of ajv#^6.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: abbrev#1.1.1 (node_modules/fsevents/node_modules/abbrev):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/abbrev' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.abbrev.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ansi-regex#2.1.1 (node_modules/fsevents/node_modules/ansi-regex):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/ansi-regex' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.ansi-regex.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: aproba#1.2.0 (node_modules/fsevents/node_modules/aproba):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/aproba' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.aproba.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: balanced-match#1.0.0 (node_modules/fsevents/node_modules/balanced-match):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/balanced-match' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.balanced-match.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: chownr#1.1.4 (node_modules/fsevents/node_modules/chownr):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/chownr' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.chownr.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: code-point-at#1.1.0 (node_modules/fsevents/node_modules/code-point-at):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/code-point-at' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.code-point-at.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: concat-map#0.0.1 (node_modules/fsevents/node_modules/concat-map):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/concat-map' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.concat-map.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: console-control-strings#1.1.0 (node_modules/fsevents/node_modules/console-control-strings):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/console-control-strings' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.console-control-strings.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: core-util-is#1.0.2 (node_modules/fsevents/node_modules/core-util-is):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/core-util-is' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.core-util-is.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: deep-extend#0.6.0 (node_modules/fsevents/node_modules/deep-extend):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/deep-extend' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.deep-extend.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: delegates#1.0.0 (node_modules/fsevents/node_modules/delegates):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/delegates' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.delegates.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: detect-libc#1.0.3 (node_modules/fsevents/node_modules/detect-libc):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/detect-libc' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.detect-libc.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs.realpath#1.0.0 (node_modules/fsevents/node_modules/fs.realpath):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/fs.realpath' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.fs.realpath.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: has-unicode#2.0.1 (node_modules/fsevents/node_modules/has-unicode):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/has-unicode' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.has-unicode.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: inherits#2.0.4 (node_modules/fsevents/node_modules/inherits):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/inherits' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.inherits.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ini#1.3.5 (node_modules/fsevents/node_modules/ini):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/ini' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.ini.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: isarray#1.0.0 (node_modules/fsevents/node_modules/isarray):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/isarray' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.isarray.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: minimist#1.2.5 (node_modules/fsevents/node_modules/minimist):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/minimist' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.minimist.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ms#2.1.2 (node_modules/fsevents/node_modules/ms):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/ms' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.ms.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: npm-normalize-package-bin#1.0.1 (node_modules/fsevents/node_modules/npm-normalize-package-bin):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/npm-normalize-package-bin' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.npm-normalize-package-bin.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: number-is-nan#1.0.1 (node_modules/fsevents/node_modules/number-is-nan):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/number-is-nan' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.number-is-nan.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: object-assign#4.1.1 (node_modules/fsevents/node_modules/object-assign):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/object-assign' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.object-assign.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: os-homedir#1.0.2 (node_modules/fsevents/node_modules/os-homedir):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/os-homedir' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.os-homedir.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: os-tmpdir#1.0.2 (node_modules/fsevents/node_modules/os-tmpdir):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/os-tmpdir' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.os-tmpdir.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: path-is-absolute#1.0.1 (node_modules/fsevents/node_modules/path-is-absolute):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/path-is-absolute' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.path-is-absolute.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: process-nextick-args#2.0.1 (node_modules/fsevents/node_modules/process-nextick-args):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/process-nextick-args' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.process-nextick-args.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: safe-buffer#5.1.2 (node_modules/fsevents/node_modules/safe-buffer):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/safe-buffer' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.safe-buffer.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: safer-buffer#2.1.2 (node_modules/fsevents/node_modules/safer-buffer):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/safer-buffer' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.safer-buffer.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sax#1.2.4 (node_modules/fsevents/node_modules/sax):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/sax' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.sax.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: semver#5.7.1 (node_modules/fsevents/node_modules/semver):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/semver' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.semver.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: set-blocking#2.0.0 (node_modules/fsevents/node_modules/set-blocking):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/set-blocking' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.set-blocking.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: signal-exit#3.0.2 (node_modules/fsevents/node_modules/signal-exit):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/signal-exit' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.signal-exit.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: strip-json-comments#2.0.1 (node_modules/fsevents/node_modules/strip-json-comments):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/strip-json-comments' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.strip-json-comments.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: util-deprecate#1.0.2 (node_modules/fsevents/node_modules/util-deprecate):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/util-deprecate' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.util-deprecate.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: wrappy#1.0.2 (node_modules/fsevents/node_modules/wrappy):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/wrappy' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.wrappy.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: yallist#3.1.1 (node_modules/fsevents/node_modules/yallist):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/vagrant/project/node_modules/fsevents/node_modules/yallist' -> '/home/vagrant/project/node_modules/fsevents/node_modules/.yallist.DELETE'
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/vagrant/project/node_modules/archive-type/node_modules/file-type/package.json.739239272
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/vagrant/project/node_modules/archive-type/node_modules/file-type/package.json.739239272'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2020-04-15T16_25_14_245Z-debug.log
Building on memonic's comment, there seems to be an issue between NPM & Virtualbox, which prevents it from working properly on Homestead. People seem to focus on Windows set ups, but I had faced the same problem on MacOS.
The method that should always work is to run NPM commands from your host OS. If you want to read other suggestions: https://github.com/laravel/homestead/issues/922#issuecomment-419229251
On MacOS, it is straightforward to use brew to install Node/NPM on the Host and then, still on the Host machine, go to the location of interest and execute the necessary NPM commands.
I have faced this problem after cloning the react application. the problem was extra dependency which is "fsevents": "file:../../node_modules/fsevents",. after remove it from package.json file everything goes right.

Can not install Polymer CLI 3

I am trying to upgrade to Polymer 3 from Polymer 2. My environment follows:
Debian Stretch
npm version 6.1.0
command run with root account: npm install -g polymer-cli
Any idea? Thank you in advance!
/usr/bin/polymer -> /usr/lib/node_modules/polymer-cli/bin/polymer.js
> wd#1.6.2 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:902: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 (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
at startup (internal/bootstrap/node.js:201:19)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.3 (node_modules/polymer-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
This seems to be caused by npm issue #17346.
The current workaround is to call npm install -g polymer-cli with the --unsafe-perm flag until a new fix is released.

polyserve cannot serve the app

Node v8.11
NPM v5.6
Whenever I try to call polymer serve an error occurs telling that server failed to start and no available ports, which is wrong! most of the ports are available.
$ polymer serve
ERROR: Server failed to start: Error: No available ports. Ports tried: [8081,8000,8001,8003,8031,2000,2001,2020,2109,2222,2310,3000,3001,3030,3210,3333,4000,4001,4040,4321,4502,4503,4567,5000,5001,5050,5432,6000,6001,6060,6666,6543,7000,7070,7774,7777,8765,8777,8888,9000,9001,9080,9090,9876,9877,9999,49221,55001]
at /Users/nabed/.config/yarn/global/node_modules/polyserve/lib/start_server.js:380:15
at Generator.next (<anonymous>)
at fulfilled (/Users/nabed/.config/yarn/global/node_modules/polyserve/lib/start_server.js:17:58)
at <anonymous>
error: cli runtime exception: Error: Error: No available ports. Ports tried: [8081,8000,8001,8003,8031,2000,2001,2020,2109,2222,2310,3000,3001,3030,3210,3333,4000,4001,4040,4321,4502,4503,4567,5000,5001,5050,5432,6000,6001,6060,6666,6543,7000,7070,7774,7777,8765,8777,8888,9000,9001,9080,9090,9876,9877,9999,49221,55001]
error: Error: Error: No available ports. Ports tried: [8081,8000,8001,8003,8031,2000,2001,2020,2109,2222,2310,3000,3001,3030,3210,3333,4000,4001,4040,4321,4502,4503,4567,5000,5001,5050,5432,6000,6001,6060,6666,6543,7000,7070,7774,7777,8765,8777,8888,9000,9001,9080,9090,9876,9877,9999,49221,55001]
at /Users/nabed/.config/yarn/global/node_modules/polyserve/lib/start_server.js:91:19
at Generator.throw (<anonymous>)
at rejected (/Users/nabed/.config/yarn/global/node_modules/polyserve/lib/start_server.js:18:65)
at <anonymous>
here is a --verbose err log text http://freetexthost.com/2sjgr45yx5
I am on mac, I installed node via package installer form there website
As #synk said on the comment:
polymer serve --hostname 0.0.0.0 or replace 0.0.0.0 with an IP
that is available on the machine

How to resolve error: EACCES: permission denied when installing Polymer 2.0

Running into an issue trying to install Polymer 2.0
I have node v 8.9.1 installed as well as bower 1.8.2.
To install polymer 2.0, I used the following statements directly from the Polymer install docs:
npm install -g polymer-cli
However, I keep running into this error and don't know how to get around it.
npm WARN deprecated bower#1.8.2: ...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 babel-preset-es2015#6.24.1: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated #types/assert#0.0.29: See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/12826
npm ERR! path /usr/local/bin/polymer
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall unlink
npm ERR! Error: EACCES: permission denied, unlink '/usr/local/bin/polymer'
npm ERR! { Error: EACCES: permission denied, unlink '/usr/local/bin/polymer'
npm ERR! cause:
npm ERR! { Error: EACCES: permission denied, unlink '/usr/local/bin/polymer'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'unlink',
npm ERR! path: '/usr/local/bin/polymer' },
npm ERR! stack: 'Error: EACCES: permission denied, unlink \'/usr/local/bin/polymer\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'unlink',
npm ERR! path: '/usr/local/bin/polymer' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jdk588/.npm/_logs/2017-12-04T14_51_46_451Z-debug.log
I've tried running the command with sudo and still no luck.
I am not sure this is the solution but here below from the Polymer page :
What versions of Node.js do we support?
We support all "Current" and "Active LTS" releases of Node.js according to the Node.js Long Term Support Release Schedule, but not "Maintenance" releases.
This means we will support from two to three semver major versions of Node.js, depending on where we are in the Node LTS schedule. Currently we support 6.x and 7.x.
So, try to downgrade the Node ver. to 6.x or 7.x