Andre
Andre

Reputation: 1322

NodeJS error when trying to run Polymer CLI

I get the following error running the polymer cli.

$ polymer
module.js:327
    throw err;
    ^

Error: Cannot find module '..'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at /usr/local/lib/node_modules/polymer-cli/bin/polymer.js:19:36
    at /usr/local/lib/node_modules/polymer-cli/node_modules/resolve/lib/async.js:46:14
    at process (/usr/local/lib/node_modules/polymer-cli/node_modules/resolve/lib/async.js:173:43)
    at ondir (/usr/local/lib/node_modules/polymer-cli/node_modules/resolve/lib/async.js:188:17)
    at load (/usr/local/lib/node_modules/polymer-cli/node_modules/resolve/lib/async.js:69:43)
    at onex (/usr/local/lib/node_modules/polymer-cli/node_modules/resolve/lib/async.js:92:31)

I've tried node 4.x and 6.x I've also tried to install different versions of polymer-cli, 0.8 and 0.10

I'm running node on Ubuntu 16.04.

Does anyone know what issue I'm running into or how I can resolve this?

Upvotes: 0

Views: 878

Answers (1)

Andre
Andre

Reputation: 1322

Ok wow after quite a lot of digging and searching, I found the answer. Turns out I had previously tried to install polymer-cli using the default ubuntu package. This installed it in a separate location, also on the global path.

When I remove NodeJS and NPM to install the latest version via the PPA, the original polymer-cli was still left on my path. So when I then installed the latest polymer-cli, this was correctly installed, but was never the one being executed since the old one was found on the path first.

I manually deleted all node_modules folders and after doing that I was able to install and run the correct version of polymer-cli, and it now works perfectly fine.

Upvotes: 1

Related Questions