L.Smith
L.Smith

Reputation: 27

Cannot find module 'webpack' - BigCommerce

Needing to run a BigCommerce site locally and not sure why it's not running. It's running an older version of Cornerstone (V4.4.0) so not sure how to fix:

Node Version: V12.22.7

NPM: 6.14.15

Stencil version - 3.7.0

Error:

Error: Cannot find module 'webpack'
Require stack:

at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helps.js:74:18)
at Object. (path-to-directory/stencil.conf.js:1:15)

As well as this:

npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t git://github.com/bigcommerce-labs/node-sass.git
npm ERR!
npm ERR! fatal: remote error:
npm ERR! The unauthenticated git protocol on port 9418 is no longer supported.
npm ERR! Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
npm ERR!
npm ERR! exited with error code: 128

I have tried moving back Node version but error persists. Checked API key incase it needed to be updated and not the issue.

Upvotes: 1

Views: 1893

Answers (2)

Keith McGowan
Keith McGowan

Reputation: 1

I ran into this same exact issue yesterday and I believe the answer has to do with recent update to security protocols outlined in the link that pops up in the errors in your console after running npm i. What I think has happened is your remote git user setup is prepended with git://, which is no longer valid and must be prepended with https:// instead. If you run the following command in your terminal, it should adjust all of your repositories globally and you should no longer have an issue:

git config --global url."https://".insteadOf git://

Now, try running npm i again and you should be good to go. I found this solution while looking to solve this same issue at https://github.com/heroku/heroku-buildpack-nodejs/issues/959

Upvotes: 0

Istvan Tabanyi
Istvan Tabanyi

Reputation: 866

Check if you have any dependency in your package.json pointing to git://github.com url. Those are now deprecated, you must use https, e.g. git+https://github.com/bigcommerce-labs/node-sass.git.

Upvotes: 2

Related Questions